jax.extend.linear_util.WrappedFun#
- class jax.extend.linear_util.WrappedFun(f, f_transformed, transforms, stores, params, in_type, debug_info)[源代码]#
表示要应用 transforms 的函数 f。
- 参数:
f (Callable) – 要转换的函数。
transforms – 一个 (gen, gen_static_args) 元组列表,表示要应用于 f 的转换。 其中 gen 是一个生成器函数,而 gen_static_args 是生成器的静态参数元组。有关生成器的预期行为,请参阅本模块开头的描述。
stores (tuple[Store | EqualStore | None, ...]) – transforms 的辅助输出的 out_store 列表。
params – 传递给 f 的额外参数,作为关键字参数,以及转换后的关键字参数。
f_transformed (Callable)
debug_info (TracingDebugInfo | None)
- __init__(f, f_transformed, transforms, stores, params, in_type, debug_info)[源代码]#
- 参数:
f (Callable)
f_transformed (Callable)
stores (tuple[Store | EqualStore | None, ...])
debug_info (TracingDebugInfo | None)
方法
__init__
(f, f_transformed, transforms, ...)call_wrapped
(*args, **kwargs)调用转换后的函数
populate_stores
(stores)将 stores 中的值复制到 self.stores 中。
wrap
(gen, gen_static_args, out_store)添加另一个转换及其存储。
属性
f
f_transformed
transforms
stores
params
in_type
debug_info