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

Method remove_unused

python/tvm/relax/binding_rewrite.py:99–114  ·  view source on GitHub ↗

Remove a statement by its variable definition if and only if it is unused. Parameters ---------- var : Var The unused variable definition. allow_undef : bool, optional Whether to allow var being undefined variable, by default False

(self, var: Var, allow_undef=False)

Source from the content-addressed store, hash-verified

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 """
101 Remove a statement by its variable definition if and only if it is unused.
102
103 Parameters
104 ----------
105 var : Var
106 The unused variable definition.
107 allow_undef : bool, optional
108 Whether to allow var being undefined variable, by default False
109
110 Raises
111 ------
112 RuntimeError if the variable is used or undefined (allow_undef=False).
113 """
114 _ffi_api.dfb_rewrite_remove_unused(self, var, allow_undef) # type: ignore
115
116 def remove_all_unused(self) -> None:
117 """

Callers 4

test_remove_unused_undefFunction · 0.95

Calls

no outgoing calls

Tested by 4

test_remove_unused_undefFunction · 0.76