[MXNET-100] Fix buggy type inference in Correlation#10135
[MXNET-100] Fix buggy type inference in Correlation#10135piiswrong merged 2 commits intoapache:masterfrom
Conversation
cjolivier01
left a comment
There was a problem hiding this comment.
this seems strange — are you setting dtype over and over? if so, why?
what’s the prototype for type_assign again?
| type_assign(&(*out_type)[0], dtype); | ||
| type_assign(&(*out_type)[1], dtype); | ||
| type_assign(&(*out_type)[2], dtype); | ||
| type_assign(&dtype, (*in_type)[1]); |
There was a problem hiding this comment.
I think you can just call ElemwiseType<2, 3>(attrs, in_attrs, out_attrs) to achieve the same purpose.
There was a problem hiding this comment.
This function does not have attrs argument, I guess what we have here is the only way to go.
There was a problem hiding this comment.
is it just trying to set all of the inputs to the first non -1 output type?
There was a problem hiding this comment.
Yes, all input and output types to the inferred type.
There was a problem hiding this comment.
sorry your statement there is kind of vague. can you please explain what you’re trying to do here? pretend i am 5 years old...
There was a problem hiding this comment.
also, you can just pass a blank NodAttrs if necessary
There was a problem hiding this comment.
also, you can just pass a blank NodAttrs if necessary
marcoabreu
left a comment
There was a problem hiding this comment.
Please add a test to catch this problem
cf6410d to
1f54998
Compare
|
@marcoabreu test added for mutual type inference in Correlation operator |
* fix buggy type inference in correlation * add test for mutual type inference
* fix buggy type inference in correlation * add test for mutual type inference
* fix buggy type inference in correlation * add test for mutual type inference
* fix buggy type inference in correlation * add test for mutual type inference
Description
There was a bug in InferType function in PR #10125, which may cause the type inference to fail under some cases.
Checklist
Essentials
make lint)Changes
Comments