tilelang.carver.template.elementwise ==================================== .. py:module:: tilelang.carver.template.elementwise Classes ------- .. autoapisummary:: tilelang.carver.template.elementwise.ElementwiseTemplate Module Contents --------------- .. py:class:: ElementwiseTemplate Bases: :py:obj:`tilelang.carver.template.base.BaseTemplate` A template for element-wise operations using TVM. .. attribute:: shape The shape of the tensor. :type: List[int] .. attribute:: dtype The data type of the tensor (default: "float16"). :type: str .. py:attribute:: shape :type: List[int] :value: None .. py:attribute:: dtype :type: str :value: 'float16' .. py:method:: get_hardware_aware_configs(arch = None, topk = 10) Retrieves hardware-aware optimization configurations. :param arch: The target hardware architecture. :type arch: TileDevice, optional :param topk: Number of top configurations to consider. :type topk: int, optional :returns: A list of optimization hints for the given architecture. :rtype: List[Hint] .. py:method:: 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. .. py:method:: params_as_dict() Returns the parameters of the template as a dictionary. :returns: A dictionary containing shape and dtype. :rtype: dict .. py:property:: class_attributes Returns class attributes as a dictionary. :returns: A dictionary representation of the class attributes. :rtype: dict .. py:method:: __repr__() Returns a string representation of the object. :returns: A string describing the instance with its parameters. :rtype: str