symbolics.py 778 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
"""Symbolic variable helpers exposed on the TileLang language surface."""

from tvm import tir

from tilelang.utils import deprecated

__all__ = ["dynamic", "symbolic"]


def dynamic(name: str, dtype: str = "int32"):
    """
    Create a TIR dynamic symbolic variable.

    Parameters:
        name (str): Identifier for the variable in generated TIR.
        dtype (str): Data type string for the variable (e.g., "int32"). Defaults to "int32".

    Returns:
        tir.Var: A TIR variable with the given name and dtype for use in TIR/TensorIR kernels.
    """
    return tir.Var(name, dtype)


24
@deprecated("T.symbolic(...)", "T.dynamic(...)", "v0.1.9")
25
26
27
def symbolic(name: str, dtype: str = "int32"):
    """Deprecated alias for `T.dynamic`."""
    return tir.Var(name, dtype)