lt_to_tt
lt_to_tt[dtype: DType, lt_layout: Layout, //, ResultLayout: TensorLayout = Layout[*?, *?]](lt: LayoutTensor[dtype, lt_layout, lt.origin, address_space=lt.address_space, element_layout=lt.element_layout, layout_int_type=lt.layout_int_type, linear_idx_type=lt.linear_idx_type, masked=lt.masked, alignment=lt.alignment]) -> TileTensor[dtype, Layout[ResultLayout._shape_types, ResultLayout._stride_types], lt.origin, address_space=lt.address_space]
Convert a LayoutTensor to a TileTensor.
Static dimensions (known at compile time) are preserved as ComptimeInt. Dynamic dimensions (UNKNOWN_VALUE) become RuntimeInt, filled from the LayoutTensor's runtime layout. The address space is preserved from the source LayoutTensor. Works for any flat rank.
By default the TileTensor layout is derived automatically from the
LayoutTensor's legacy layout. Pass an explicit ResultLayout to
override which dimensions are static vs runtime.
Parameters:
- dtype (
DType): Element type of the tensor. - lt_layout (
Layout): The legacy Layout of the LayoutTensor. - ResultLayout (
TensorLayout): The target TileTensor layout type. Defaults toLTToTTLayout[lt_layout].
Args:
- lt (
LayoutTensor): The LayoutTensor to convert.
Returns:
TileTensor: A TileTensor with the same data, equivalent layout, and matching
address space.