Skip to main content

Mojo module

managed_tensor_slice

ManagedTensorSlice and the types kernel authors compose against.

A custom kernel's entry-point signature uses these:

  • ManagedTensorSlice β€” view of a tensor argument.
  • IOSpec (and IO) β€” input/output/mutability annotations.
  • RuntimeTensorSpec / StaticTensorSpec β€” runtime + compile-time tensor metadata.
  • Fusion traits (InputFusion, OutputFusion, ...) and their _NoFusion* sentinels.

The decorators that register a kernel (register, register_internal, view_kernel) live next to this file in register.mojo.

comptime values​

DynamicTensor​

comptime DynamicTensor[dtype: DType, rank: Int] = ManagedTensorSlice[IOUnknown, static_spec=_get_unknown_tensor_spec[dtype, rank]()]

Parameters​

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

FusedInput​

comptime FusedInput = IOSpec()

FusedOutput​

comptime FusedOutput = IOSpec()

Input​

comptime Input = IOSpec()

InputTensor​

comptime InputTensor = ManagedTensorSlice[Input, static_spec=?]

InputVariadicTensors​

comptime InputVariadicTensors = VariadicTensors[?, Input, static_specs=?]

IOUnknown​

comptime IOUnknown = IOSpec()

MutableInput​

comptime MutableInput = IOSpec()

Output​

comptime Output = IOSpec()

OutputTensor​

comptime OutputTensor = ManagedTensorSlice[Output, static_spec=?]

OutputVariadicTensors​

comptime OutputVariadicTensors = VariadicTensors[?, Output, static_specs=?]

Structs​

Traits​

Functions​