Skip to content

Commit

Permalink
Don't add cast for TF batch norm when type isn't changing
Browse files Browse the repository at this point in the history
  • Loading branch information
Trevor Morris committed Jun 4, 2020
1 parent 34c95a8 commit ae2a5dc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/tvm/relay/frontend/tensorflow.py
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 ae2a5dc

Please sign in to comment.