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

Method add

python/tvm/relax/binding_rewrite.py:77–97  ·  view source on GitHub ↗

Add a new statement to the DataflowBlock with an automatically generated variable name. Parameters ---------- expr : Expr The expression to add. name : Optional[str], optional Variable name, by default None is_dfvar : bool, op

(self, expr: Expr, name: str | None = None, is_dfvar: bool = False)

Source from the content-addressed store, hash-verified

75 return _ffi_api.dfb_rewrite_add_binding(self, binding) # type: ignore
76
77 def add(self, expr: Expr, name: str | None = None, is_dfvar: bool = False) -> None:
78 """
79 Add a new statement to the DataflowBlock with an automatically generated variable name.
80
81 Parameters
82 ----------
83 expr : Expr
84 The expression to add.
85 name : Optional[str], optional
86 Variable name, by default None
87 is_dfvar : bool, optional
88 The variable type, by default False
89
90 Notes
91 -----
92 If the variable name is not given, it will be automatically generated in a form of
93 "tmp${COUNTER}". The variable type will be DataflowVar if is_dfvar is True, otherwise
94 it will be Var. Being Var means the variables are output variables of the DataflowBlock.
95 While being DataflowVar means the variables are internal variables of the DataflowBlock.
96 """
97 _ffi_api.dfb_rewrite_add(self, expr, name, is_dfvar) # type: ignore
98
99 def remove_unused(self, var: Var, allow_undef=False) -> None:
100 """

Callers 15

test_simple_addFunction · 0.95
test_simple_auto_add_varFunction · 0.95
_populate_bound_varsFunction · 0.45
_convert_call_tirMethod · 0.45
visit_function_defFunction · 0.45
visit_argumentsFunction · 0.45
visit_withFunction · 0.45
visit_ifFunction · 0.45

Calls

no outgoing calls

Tested by 4

test_simple_addFunction · 0.76
test_simple_auto_add_varFunction · 0.76