-
Notifications
You must be signed in to change notification settings - Fork 6.8k
[MXNET-100] Fix buggy type inference in Correlation #10135
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it just trying to set all of the inputs to the first non -1 output type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, all input and output types to the inferred type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, you can just pass a blank NodAttrs if necessary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, you can just pass a blank NodAttrs if necessary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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