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

Method main

tests/python/relax/test_transform_gradient_numeric.py:49–63  ·  view source on GitHub ↗
(
            x: R.Tensor((3, 5), "float32"),
            y: R.Tensor((5,), "float32"),
            z: R.Tensor((5,), "float32"),
            u: R.Tensor((5,), "float32"),
        )

Source from the content-addressed store, hash-verified

47 class Before:
48 @R.function
49 def main(
50 x: R.Tensor((3, 5), "float32"),
51 y: R.Tensor((5,), "float32"),
52 z: R.Tensor((5,), "float32"),
53 u: R.Tensor((5,), "float32"),
54 ):
55 with R.dataflow():
56 lv1 = R.add(x, x)
57 lv2 = R.subtract(lv1, y)
58 lv3 = R.subtract(lv2, y)
59 lv4 = R.add(y, z)
60 lv5 = R.multiply(lv3, lv4)
61 lv6 = R.sum(lv5)
62 R.output(lv6)
63 return lv6
64
65 After = relax.transform.Gradient("main")(Before)
66

Calls 12

TensorMethod · 0.80
dataflowMethod · 0.80
subtractMethod · 0.80
outputMethod · 0.80
log_softmaxMethod · 0.80
nll_lossMethod · 0.80
addMethod · 0.45
multiplyMethod · 0.45
sumMethod · 0.45
splitMethod · 0.45
permute_dimsMethod · 0.45
matmulMethod · 0.45

Tested by

no test coverage detected