Mojo struct
VariadicTensors
@register_passable(trivial)
struct VariadicTensors[mut: Bool, input: IO, //, type: DType, rank: Int, size: Int, io_spec: IOSpec[mut, input], *, static_specs: StaticTuple[StaticTensorSpec[type, rank], size]]
A tuple-like container of tensors representing variadic arguments from the graph compiler.
Implemented traits
AnyType
,
Copyable
,
ExplicitlyCopyable
,
Movable
,
Sized
,
UnknownDestructibility
Methods
__getitem__
__getitem__[index: Int](self) -> ManagedTensorSlice[io_spec, static_spec=static_specs.__getitem__[::Indexer](index)]
Returns the tensor at the given position in the variadic argument argument pack.
Parameters:
- index (
Int
): The index into the variadic tensor arguments.
Returns:
The tensor at the specified index.
__len__
__len__(self) -> Int
Returns the number of variadic arguments in the pack.
Returns:
The number of variadic arguments.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!