Skip to main content

Mojo module

managed_tensor_slice

Implements the ManagedTensorSlice type - a view of a tensor that doesn't own the underlying data. This type is used to build custom graph operations.

Aliases

DynamicTensor

alias DynamicTensor[dtype: DType, rank: Int] = ManagedTensorSlice[IOSpec[True, IO(-1)](), static_spec=StaticTensorSpec.create_unknown[dtype, rank]()]

Parameters

  • dtype (DType):
  • rank (Int):

InputTensor

alias InputTensor = ManagedTensorSlice[IOSpec[False, IO(1)](), static_spec=?]

InputVariadicTensors

alias InputVariadicTensors = VariadicTensors[?, ?, ?, IOSpec[False, IO(1)](), static_specs=?]

OutputTensor

alias OutputTensor = ManagedTensorSlice[IOSpec[True, IO(0)](), static_spec=?]

OutputVariadicTensors

alias OutputVariadicTensors = VariadicTensors[?, ?, ?, IOSpec[True, IO(0)](), static_specs=?]

Structs

  • ManagedTensorSlice: A view of a tensor that does not own the underlying allocated pointer. When the object lifetime ends it does not free the underlying pointer. Conversely, if a ManagedTensorSlice is created, it will not extend the life of the underlying pointer.
  • VariadicTensors: A tuple-like container of tensors representing variadic arguments from the graph compiler.

Functions

Was this page helpful?