MCPcopy Create free account
hub / github.com/apache/tvm / has_dtype

Function has_dtype

python/tvm/relax/dpl/pattern.py:812–831  ·  view source on GitHub ↗

Syntatic sugar for creating a DataTypePattern Parameters ---------- dtype: str The dtype to match pattern: tvm.relax.dpl.DFPattern The pattern that needs type annotation Returns ------- result: tvm.relax.dpl.DataTypePattern The resulting Da

(dtype: str, pattern: DFPattern = None)

Source from the content-addressed store, hash-verified

810
811
812def has_dtype(dtype: str, pattern: DFPattern = None) -> DataTypePattern:
813 """
814 Syntatic sugar for creating a DataTypePattern
815
816 Parameters
817 ----------
818 dtype: str
819 The dtype to match
820
821 pattern: tvm.relax.dpl.DFPattern
822 The pattern that needs type annotation
823
824 Returns
825 -------
826 result: tvm.relax.dpl.DataTypePattern
827 The resulting DataTypePattern
828 """
829 if pattern is None:
830 pattern = wildcard()
831 return DataTypePattern(pattern, dtype)
832
833
834def is_shape(shape: list[tvm.ir.PrimExpr]) -> "PrimArrPattern":

Callers 3

has_dtypeMethod · 0.85
test_and_patternFunction · 0.85
test_dtype_patternFunction · 0.85

Calls 2

wildcardFunction · 0.85
DataTypePatternClass · 0.85

Tested by 2

test_and_patternFunction · 0.68
test_dtype_patternFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…