-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RELAY][FRONTEND][TENSORFLOW] Fix FuseBatchNorm output cast error if need_cast is True #4894
Conversation
@kevinthesun @FrozenGene can you please review this patch |
@@ -897,6 +897,7 @@ def _impl(inputs, attr, params): | |||
disables=['momentum'])(inputs, attr) | |||
|
|||
if need_cast: | |||
out = _expr.TupleGetItem(out.astuple(), 0) |
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 this related to float16?
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 converted a float16 tf model containing the FusedBatchNorm operator.
For the float16 model, the output of the FusedBatchNorm layer is converted back to float16(there may be other quantization types).
But the FusedBatchNorm layer has 3 outputs, if passed directly to the Cast layer will cause an exception error.
So this modification only takes its first calculation output and passes it to the Cast
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.
It's true. I too see this recently and above change should fix it.
9d1bb50
to
79204cb
Compare
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.
LGTM
Thanks @yhcvb @srkreddy1238 |
No description provided.