Module dfdx::nn::tensor_collection
source · Expand description
Traits to define a TensorCollection and how to iterate them using ModuleVisitor. Use RecursiveWalker to do the iteration and TensorVisitor to define functions to iterate through and/or construct Modules.
Structs
- A ModuleFields that represents a field that contains one or more Tensors.
- A standard ModuleVisitor that executes
F
on every Tensor encountered.F
must implement TensorVisitor - A ModuleFields that represents a field that contains a scalar value that should be serialized.
- Options to change behavior of ModuleVisitor
- A ModuleFields that represents a field that contains a single Tensor.
- Options to change behavior of ModuleVisitor
Enums
- A TensorViewer that represents a
&mut Tensor
- A TensorViewer that represents a Tensor’s name as a
String
- A TensorViewer that represents a
&Tensor
Traits
- A list of a Module’s fields. Used in ModuleVisitor::visit_fields.
- An object that can visit TensorCollections and Tensors recursively.
- A collection of named tensors. Implementing this trait will enable anything that operates on tensors, including resetting, counting number of params, updating gradients, building model, and converting models between devices or dtypes.
- Something that can view Tensors in different ways. For example ViewTensorRef can view
&Tensor
, and ViewTensorMut can view `&mut Tensor. - Something that can visit Tensors. Used in conjunction with RecursiveWalker.