tilelang.carver.template.elementwise

Classes

ElementwiseTemplate

A template for element-wise operations using TVM.

Module Contents

class tilelang.carver.template.elementwise.ElementwiseTemplate

Bases: tilelang.carver.template.base.BaseTemplate

A template for element-wise operations using TVM.

shape

The shape of the tensor.

Type:

List[int]

dtype

The data type of the tensor (default: "float16").

Type:

str

shape: list[int] = None
dtype: str = 'float16'
get_hardware_aware_configs(arch=None, topk=10)

Retrieves hardware-aware optimization configurations.

参数:
  • arch (TileDevice, optional) -- The target hardware architecture.

  • topk (int, optional) -- Number of top configurations to consider.

返回:

A list of optimization hints for the given architecture.

返回类型:

List[Hint]

initialize_function()

Initializes the element-wise computation function.

Defines a simple element-wise computation: B = A + 1, where A is an input tensor. The computation graph is built using TVM's tensor expressions.

返回类型:

None

params_as_dict()

Returns the parameters of the template as a dictionary.

返回:

A dictionary containing shape and dtype.

返回类型:

dict

property class_attributes

Returns class attributes as a dictionary.

返回:

A dictionary representation of the class attributes.

返回类型:

dict

__repr__()

Returns a string representation of the object.

返回:

A string describing the instance with its parameters.

返回类型:

str