You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2019/08/09 20:31:58 UTC
[GitHub] [incubator-mxnet] anirudh2290 commented on a change in pull request
#15829: Fix ConcatType backward type inference
anirudh2290 commented on a change in pull request #15829: Fix ConcatType backward type inference
URL: https://github.com/apache/incubator-mxnet/pull/15829#discussion_r312638606
##########
File path: src/operator/nn/concat.cc
##########
@@ -154,18 +155,29 @@ bool ConcatType(const nnvm::NodeAttrs& attrs,
}
}
- if (dtype == -1) {
- LOG(FATAL) << "Not enough information to infer type in Concat.";
- return false;
- }
-
size_t nin = param_.num_args;
- in_type->clear();
- for (size_t i = 0; i < nin; ++i) in_type->push_back(dtype);
-
- out_type->clear();
- out_type->push_back(dtype);
+ // if in types are known out types are unknown
+ if (dtype != -1 && (*out_type)[0] == -1) {
+ (*out_type)[0] = dtype;
+ in_type->clear();
+ for (size_t i = 0; i < nin; ++i) {
+ in_type->push_back(dtype);
+ }
+ // if out types are known in types are unknown
+ } else if ((*out_type)[0] != -1 && dtype == -1) {
+ in_type->clear();
+ for (size_t i = 0; i < nin; ++i) {
+ in_type->push_back((*out_type)[0]);
+ }
+ // if both out_types and in_types are known, and different
+ } else if ((*out_type)[0] != -1 && dtype != -1 && ((*out_type)[0] != dtype)) {
+ std::ostringstream os;
+ os << "Type inconsistent, Provided = "
Review comment:
within InferType logic InferTypeError is thrown for example: https://github.com/apache/incubator-mxnet/blob/master/src/operator/operator_common.h#L229
I was trying to keep it consistent with this. I can change the message to Provided output type
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services