tilelang.carver.template.elementwise¶
Classes¶
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.
- Parameters:
arch (TileDevice, optional) – The target hardware architecture.
topk (int, optional) – Number of top configurations to consider.
- Returns:
A list of optimization hints for the given architecture.
- Return type:
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.
- Return type:
None
- params_as_dict()¶
Returns the parameters of the template as a dictionary.
- Returns:
A dictionary containing shape and dtype.
- Return type:
dict
- property class_attributes¶
Returns class attributes as a dictionary.
- Returns:
A dictionary representation of the class attributes.
- Return type:
dict
- __repr__()¶
Returns a string representation of the object.
- Returns:
A string describing the instance with its parameters.
- Return type:
str