Skip to content

Commit

Permalink
Don't add cast for TF batch norm when type isn't changing (#5731)
Browse files Browse the repository at this point in the history
  • Loading branch information
Trevor Morris authored Jun 8, 2020
1 parent 6ae439c commit 2e1ef8e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/tvm/relay/frontend/tensorflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -1227,7 +1227,7 @@ def _impl(inputs, attr, params, mod):
attr['data_format'] = attr['data_format'].decode("utf-8")
if attr['data_format'] == 'NCHW':
axis = 1
if 'U' in attr:
if 'U' in attr and attr['U'].name != attr['T'].name:
need_cast = True
inputs[0] = _op.cast(inputs[0], dtype=attr['U'].name)
# Check if mean and variance are empty
Expand Down

0 comments on commit 2e1ef8e

Please sign in to comment.