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

Method main

tests/python/relax/test_frontend_from_fx.py:3072–3084  ·  view source on GitHub ↗
(inp_0: R.Tensor((1, 3, 10, 10), dtype="float32"))

Source from the content-addressed store, hash-verified

3070 class expected_hardswish:
3071 @R.function
3072 def main(inp_0: R.Tensor((1, 3, 10, 10), dtype="float32")) -> R.Tensor(
3073 (1, 3, 10, 10), dtype="float32"
3074 ):
3075 with R.dataflow():
3076 lv: R.Tensor((1, 3, 10, 10), dtype="float32") = R.add(inp_0, R.const(3, "float32"))
3077 lv1: R.Tensor((1, 3, 10, 10), dtype="float32") = R.clip(lv, 0, 6)
3078 lv2: R.Tensor((1, 3, 10, 10), dtype="float32") = R.divide(
3079 lv1, R.const(6, "float32")
3080 )
3081 lv3: R.Tensor((1, 3, 10, 10), dtype="float32") = R.multiply(inp_0, lv2)
3082 gv: R.Tensor((1, 3, 10, 10), dtype="float32") = lv3
3083 R.output(gv)
3084 return gv
3085
3086 verify_model(Hardswish(), input_info, {}, expected_hardswish)
3087 verify_model(Hardswish2(), input_info, {}, expected_hardswish)

Callers

nothing calls this directly

Calls 6

TensorMethod · 0.80
dataflowMethod · 0.80
outputMethod · 0.80
addMethod · 0.45
divideMethod · 0.45
multiplyMethod · 0.45

Tested by

no test coverage detected