Mojo struct
StaticTensorSpec
struct StaticTensorSpec[dtype: DType, rank: Int, static_layout: TensorLayout, InFusion: InputFusion = _NoFusionIn, OutFusion: OutputFusion = _NoFusionOut, ComputeFusion: ComputeOutputFusion = _NoComputeFusion]
Fieldsβ
- βalignment (
Int): - βaddress_space (
AddressSpace): - βexclusive (
Bool):
Implemented traitsβ
AnyType,
Copyable,
ImplicitlyCopyable,
ImplicitlyDestructible,
Movable
comptime membersβ
get_unknownβ
comptime get_unknown = fn_literal
shape_tupleβ
comptime shape_tuple = coord_to_int_tuple[static_layout._shape_types]()
static_sizeβ
comptime static_size = Layout(coord_to_int_tuple[static_layout._shape_types](), coord_to_int_tuple[static_layout._stride_types]()).size()
strides_tupleβ
comptime strides_tuple = coord_to_int_tuple[static_layout._stride_types]()
Methodsβ
__init__β
__init__(out self, alignment: Int, address_space: AddressSpace, exclusive: Bool)
__init__(out self, internals: StaticTensorSpecInternal[dtype, rank])
Returns a StaticTensorSpec from a StaticTensorSpecInternal.
to_unfusedβ
to_unfused(self) -> StaticTensorSpec[dtype, rank, static_layout]
Returns a copy with sentinel (no-op) fusion types.
The runtime fields (alignment, etc.) are identical; only the compile-time fusion type parameters change.
Returns:
with_tile_layoutβ
with_tile_layout[new_layout: TensorLayout](self) -> StaticTensorSpec[dtype, new_layout.rank, new_layout]
Returns:
with_tile_layout[new_rank: Int, new_layout: TensorLayout](self) -> StaticTensorSpec[dtype, new_rank, new_layout]
Returns:
with_tile_layout_and_alignmentβ
with_tile_layout_and_alignment[new_layout: TensorLayout](self, new_alignment: Int) -> StaticTensorSpec[dtype, new_layout.rank, new_layout]
Returns:
with_tile_layout_and_alignment[new_rank: Int, new_layout: TensorLayout](self, new_alignment: Int) -> StaticTensorSpec[dtype, new_rank, new_layout]
Returns:
with_int_tuple_layoutβ
with_int_tuple_layout[new_rank: Int, new_shape: IntTuple, new_strides: IndexList[new_strides.size, element_type=new_strides.element_type]](self) -> StaticTensorSpec[dtype, new_rank, Layout[*?, *?]]
Returns:
with_int_tuple_layout_and_alignmentβ
with_int_tuple_layout_and_alignment[new_rank: Int, new_shape: IntTuple, new_strides: IndexList[new_strides.size, element_type=new_strides.element_type]](self, new_alignment: Int) -> StaticTensorSpec[dtype, new_rank, Layout[*?, *?]]
Returns:
with_row_major_int_tuple_layoutβ
with_row_major_int_tuple_layout[new_rank: Int, new_shape: IntTuple](self) -> StaticTensorSpec[dtype, new_rank, Layout[*?, *?]]
Returns:
with_input_fusionβ
with_input_fusion[F: InputFusion](self) -> StaticTensorSpec[dtype, rank, static_layout, F, OutFusion, ComputeFusion]
Returns:
StaticTensorSpec[dtype, rank, static_layout, F, OutFusion, ComputeFusion]
with_output_fusionβ
with_output_fusion[F: OutputFusion](self) -> StaticTensorSpec[dtype, rank, static_layout, InFusion, F, ComputeFusion]
Returns:
StaticTensorSpec[dtype, rank, static_layout, InFusion, F, ComputeFusion]
with_compute_fusionβ
with_compute_fusion[F: ComputeOutputFusion](self) -> StaticTensorSpec[dtype, rank, static_layout, InFusion, OutFusion, F]
Returns:
StaticTensorSpec[dtype, rank, static_layout, InFusion, OutFusion, F]
to_layoutβ
to_layout(self) -> Layout
Returns:
Layout
get_internalsβ
get_internals(self) -> StaticTensorSpecInternal[dtype, rank]
Returns a StaticTensorSpecInternal from a StaticTensorSpec.
Returns:
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!