MCPcopy
hub / github.com/apache/tvm / func1

Method func1

tests/python/relax/test_transform_static_plan_block_memory.py:867–888  ·  view source on GitHub ↗
(
            x: R.Tensor((2, 3), dtype="float32"), y: R.Tensor((2, 3), dtype="int32")
        )

Source from the content-addressed store, hash-verified

865
866 @R.function
867 def func1(
868 x: R.Tensor((2, 3), dtype="float32"), y: R.Tensor((2, 3), dtype="int32")
869 ) -> R.Tensor((2, 3), dtype="float32"):
870 R.func_attr({"relax.force_pure": True})
871 cls = Expected
872 storage: R.Object = R.memory.alloc_storage(
873 R.shape([24]), virtual_device_index=0, storage_scope="global", dtype="float32"
874 )
875 alloc: R.Tensor((2, 3), dtype="float32") = R.memory.alloc_tensor(
876 storage, 0, R.shape([2, 3]), dtype="float32"
877 )
878 _: R.Tuple() = cls.add(x, x, alloc)
879 gv1: R.Tensor((2, 3), dtype="float32") = alloc
880 storage1: R.Object = R.memory.alloc_storage(
881 R.shape([24]), virtual_device_index=0, storage_scope="global", dtype="int32"
882 )
883 alloc1: R.Tensor((2, 3), dtype="int32") = R.memory.alloc_tensor(
884 storage1, 0, R.shape([2, 3]), dtype="int32"
885 )
886 _2: R.Tuple() = cls.add1(y, y, alloc1)
887 gv12: R.Tensor((2, 3), dtype="int32") = alloc1
888 return x
889
890 @R.function
891 def func2(

Callers

nothing calls this directly

Calls 6

TensorMethod · 0.80
shapeMethod · 0.45
addMethod · 0.45
add1Method · 0.45
dtypeMethod · 0.45
expMethod · 0.45

Tested by

no test coverage detected