Type Aliases
Types and type aliases used by Minnt.
AnyArray
module-attribute
A type alias for any array-like structure.
PyTorch tensors, NumPy arrays, lists, and tuples are supported.
HasCompute
Bases: Protocol
A protocol for objects that have a compute method.
Source code in minnt/type_aliases.py
20 21 22 23 24 25 | |
Logs
module-attribute
A dictionary of logs, with keys being the log names and values being the log values.
When the logs are returned by the TrainableModule, they are always just float values.
Tensor
module-attribute
Tensor: TypeAlias = Tensor | PackedSequence
A type alias for a single tensor or a packed sequence of tensors.
TensorOrTensors
module-attribute
A type alias for a single tensor/packed sequence of a sequence of them.
While a tensor or a tuple of them is the most common, any type is allowed here to accomodate dictionaries or custom data structures.