ekalda commented on a change in pull request #9515:
URL: https://github.com/apache/tvm/pull/9515#discussion_r751049064
##########
File path: tests/python/contrib/test_ethosu/test_codegen.py
##########
@@ -435,6 +435,56 @@ def representative_dataset():
infra.verify_source(compiled_models, accel_type)
[email protected]("accel_type", ACCEL_TYPES)
+def test_binary_add_from_constant_scalar(accel_type):
+ dtype = "uint8"
+ ifm_shape = (1, 4, 4, 8)
+
+ def create_relay_graph():
+ inp = relay.var("input", shape=ifm_shape, dtype=dtype)
+ scalar = relay.const(np.ones((1, 1, 1, 1), dtype=dtype), dtype=dtype)
+ add = relay.qnn.op.add(
+ inp,
+ scalar,
+ relay.const(1.0, dtype="float32"),
+ relay.const(0, dtype="int32"),
+ relay.const(1.0, dtype="float32"),
+ relay.const(0, dtype="int32"),
+ relay.const(1.0, dtype="float32"),
+ relay.const(0, dtype="int32"),
+ )
+ func = relay.Function(relay.analysis.free_vars(add), add)
Review comment:
Ok yes, that makes sense!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]