lhutton1 commented on a change in pull request #8669:
URL: https://github.com/apache/tvm/pull/8669#discussion_r686854603
##########
File path: tests/python/contrib/test_arm_compute_lib/test_dense.py
##########
@@ -154,7 +154,7 @@ def _get_expected_codegen(shape, weight_shape, units,
dtype, has_bias=False):
{
"op": "const",
"name": "",
- "attrs": {"shape": [[[weight_shape[0]]]], "dtype":
[[bias_dtype]]},
+ "attrs": {"shape": [[[1, weight_shape[0]]]], "dtype":
[[bias_dtype]]},
Review comment:
Hi @masahi, it looks like a 2D bias shape is only enforced for dense but
not qnn.dense. The json generation in this test covers both dense and qnn.dense
operations. It also looks like a bias of shape (1) remains of shape (1) rather
than (1, 1) like other sizes, is this intended? Perhaps this change would fix
this, given the current changes:
```suggestion
if has_bias:
bias_dtype = "int32" if dtype == "uint8" else "float32"
bias_shape = [1, weight_shape[0]] if dtype == "float32" and \
weight_shape[0] != 1 else [weight_shape[0]]
inputs.append(
{
"op": "const",
"name": "",
"attrs": {"shape": [[bias_shape]], "dtype": [[bias_dtype]]},
}
)
```
Hope that helps!
--
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]