manupa-arm commented on a change in pull request #10348:
URL: https://github.com/apache/tvm/pull/10348#discussion_r813752267
##########
File path: src/relay/backend/contrib/cmsisnn/scalar_to_tensor_constant.cc
##########
@@ -117,21 +117,19 @@ class ScalarToTensorConstantMutator : public
MixedModeMutator {
for (uint32_t i = 0; i < call->args.size(); ++i) {
Expr arg = call->args[i];
new_args.push_back(arg);
- if (!arg->checked_type_.defined()) {
- continue;
- }
- auto* arg_type = arg->type_as<TensorTypeNode>();
- if (arg_type->shape.size() != 0 || arg.as<ConstantNode>()) {
+ const auto* arg_var = arg.as<VarNode>();
+ const auto* arg_type = arg->checked_type_.as<TensorTypeNode>();
+ if (!arg_var || !arg_type || arg_type->shape.size() != 0) {
Review comment:
nit : could use "->IsInstance\<VarNode\>() if arg_var and arg_type is
not used anymore.
--
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]