MCPcopy Index your code
hub / github.com/apache/tvm / VariableReplacer

Class VariableReplacer

tests/python/tirx-transform/test_tir_functor.py:107–117  ·  view source on GitHub ↗

Replace variables with constants

Source from the content-addressed store, hash-verified

105
106@tirx.functor.mutator
107class VariableReplacer(PyStmtExprMutator):
108 """Replace variables with constants"""
109
110 def __init__(self, replacements):
111 super().__init__()
112 self.replacements = replacements
113
114 def visit_var_(self, op: Var):
115 if op.name in self.replacements:
116 return IntImm("int32", self.replacements[op.name])
117 return op
118
119
120@tirx.functor.mutator

Callers 3

test_variable_replacerFunction · 0.85
test_simple_mutationsFunction · 0.85

Calls

no outgoing calls

Tested by 3

test_variable_replacerFunction · 0.68
test_simple_mutationsFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…