yhcvb commented on a change in pull request #4894:
[RELAY][FRONTEND][TENSORFLOW] Fix FuseBatchNorm output cast error if need_cast
is True
URL: https://github.com/apache/incubator-tvm/pull/4894#discussion_r381042228
##########
File path: python/tvm/relay/frontend/tensorflow.py
##########
@@ -897,6 +897,7 @@ def _impl(inputs, attr, params):
disables=['momentum'])(inputs, attr)
if need_cast:
+ out = _expr.TupleGetItem(out.astuple(), 0)
Review comment:
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
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services