pytorch
1.8.2
About: PyTorch provides Tensor computation (like NumPy) with strong GPU acceleration and Deep Neural Networks (in Python) built on a tape-based autograd system. LTS (Long Term Support) release.
![]() ![]() |
Classes | |
class | LeafSpec |
class | NodeDef |
class | TreeSpec |
Functions | |
None | _register_pytree_node (Any typ, FlattenFunc flatten_fn, UnflattenFunc unflatten_fn) |
Tuple[List[Any], Context] | _dict_flatten (Dict[Any, Any] d) |
Dict[Any, Any] | _dict_unflatten (List[Any] values, Context context) |
Tuple[List[Any], Context] | _list_flatten (List[Any] d) |
List[Any] | _list_unflatten (List[Any] values, Context context) |
Tuple[List[Any], Context] | _tuple_flatten (Tuple[Any,...] d) |
Tuple[Any,...] | _tuple_unflatten (List[Any] values, Context context) |
bool | _is_leaf (PyTree pytree) |
Tuple[List[Any], TreeSpec] | tree_flatten (PyTree pytree) |
PyTree | tree_unflatten (List[Any] values, TreeSpec spec) |
Optional[List[Any]] | _broadcast_to_and_flatten (PyTree pytree, TreeSpec spec) |
Variables | |
Context = Any | |
PyTree = Any | |
FlattenFunc = Callable[[PyTree], Tuple[List, Context]] | |
UnflattenFunc = Callable[[List, Context], PyTree] | |
|
private |
Definition at line 163 of file _pytree.py.
References torch.utils._pytree._broadcast_to_and_flatten(), torch.utils._pytree._is_leaf(), c10::prim.isinstance(), c10::aten.len(), type, and c10::prim.zip().
Referenced by torch.utils._pytree._broadcast_to_and_flatten(), and torch._vmap_internals._create_batched_inputs().
Definition at line 41 of file _pytree.py.
References torch.utils._pytree._dict_flatten(), and c10::prim.list().
Referenced by torch.utils._pytree._dict_flatten().
Definition at line 44 of file _pytree.py.
References torch.utils._pytree._dict_unflatten(), and c10::prim.zip().
Referenced by torch.utils._pytree._dict_unflatten().
|
private |
Definition at line 65 of file _pytree.py.
References torch.utils._pytree._is_leaf(), and type.
Referenced by torch.utils._pytree._broadcast_to_and_flatten(), torch.utils._pytree._is_leaf(), and torch.utils._pytree.tree_flatten().
Definition at line 47 of file _pytree.py.
References torch.utils._pytree._list_flatten().
Referenced by torch.utils._pytree._list_flatten().
Definition at line 50 of file _pytree.py.
References torch.utils._pytree._list_unflatten(), and c10::prim.list().
Referenced by torch.utils._pytree._list_unflatten().
|
private |
Definition at line 38 of file _pytree.py.
References torch.utils._pytree._register_pytree_node().
Referenced by torch.utils._pytree._register_pytree_node(), and torch.utils._pytree._tuple_unflatten().
Definition at line 53 of file _pytree.py.
References torch.utils._pytree._tuple_flatten(), and c10::prim.list().
Referenced by torch.utils._pytree._tuple_flatten().
Definition at line 56 of file _pytree.py.
References torch.utils._pytree._register_pytree_node(), and torch.utils._pytree._tuple_unflatten().
Referenced by torch.utils._pytree._tuple_unflatten().
Flattens a pytree into a list of values and a TreeSpec that can be used to reconstruct the pytree.
Definition at line 104 of file _pytree.py.
References torch.utils._pytree._is_leaf(), torch.utils._pytree.tree_flatten(), and type.
Referenced by torch._vmap_internals._create_batched_inputs(), and torch.utils._pytree.tree_flatten().
Given a list of values and a TreeSpec, builds a pytree. This is the inverse operation of `tree_flatten`.
Definition at line 125 of file _pytree.py.
References c10::prim.isinstance(), c10::aten.len(), and torch.utils._pytree.tree_unflatten().
Referenced by torch._vmap_internals._create_batched_inputs(), and torch.utils._pytree.tree_unflatten().
torch.utils._pytree.Context = Any |
Definition at line 27 of file _pytree.py.
Referenced by org.pytorch.PytorchInstrumentedTests.assetFilePath(), at::native::vulkan::api.context(), at::native::vulkan::ops.copy_(), caffe2::QTensorDeserializer< Context >.Deserialize(), caffe2::python::TensorFeeder< Context >.FeedTensor(), main(), caffe2::OpenCLContextSingleton.OpenCLContextSingleton(), and at::native::vulkan::Conv2dOpContext.run().
Definition at line 29 of file _pytree.py.
torch.utils._pytree.PyTree = Any |
Definition at line 28 of file _pytree.py.
Definition at line 30 of file _pytree.py.