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

Method use_invoke_pure_closure

tests/python/relax/test_transform.py:201–205  ·  view source on GitHub ↗
(x: R.Tensor((), "int32"))

Source from the content-addressed store, hash-verified

199
200 @R.function
201 def use_invoke_pure_closure(x: R.Tensor((), "int32")) -> R.Tensor((), "int32"):
202 R.func_attr({"relax.force_pure": True})
203 closure = R.make_closure(Expected.base, ())
204 res = R.invoke_closure(closure, (x,), sinfo_args=R.Tensor((), "int32"))
205 return res
206
207 @R.function(pure=False)
208 def impure_func() -> R.Object:

Callers

nothing calls this directly

Calls 2

TensorMethod · 0.80
invoke_closureMethod · 0.80

Tested by

no test coverage detected