tilelang.layout.layout module#

Wrapping Layouts.

class tilelang.layout.layout.Layout(shape, forward_fn)#

Bases: Node

get_forward_vars()#

Retrieve the iteration variables associated with the layout.

Returns:

A list of iteration variables that define the layout transformation.

Return type:

List[IterVar]

get_input_shape()#

Get the input shape of the layout.

Returns:

The shape of the input layout.

Return type:

List[int]

get_output_shape()#

Get the output shape of the layout.

Returns:

The shape of the output layout.

Return type:

List[int]

property index#

Property to retrieve the forward index of the layout.

Returns:

The computed forward index expression(s).

Return type:

PrimExpr or List[PrimExpr]

inverse() Layout#

Compute the inverse of the current layout transformation.

Returns:

A new Layout object representing the inverse transformation.

Return type:

Layout

map_forward_index(indices: List[PrimExpr]) PrimExpr#

Compute the forward index mapping for a given set of input indices.

Parameters:

indices (list of PrimExpr) – The input indices to be mapped to their corresponding output indices.

Returns:

The mapped index expression for the provided input indices.

Return type:

PrimExpr