Normalize version-specific differences for Union types.

PiperOrigin-RevId: 321210532
Change-Id: I17b33b10c9370d679350957548ae34a1f35e1c88
This commit is contained in:
Dan Moldovan 2020-07-14 12:26:19 -07:00 committed by TensorFlower Gardener
parent 89ad1cc24b
commit 842df9e6b5

View File

@ -95,11 +95,13 @@ else:
return False
# Differences created by Generic typing.
# Differences created by typing implementations.
_NORMALIZE_TYPE[(
'tensorflow.python.framework.ops.Tensor')] = (
"<class 'tensorflow.python.framework.ops.Tensor'>")
_NORMALIZE_TYPE['typing.Generic'] = "<class 'typing.Generic'>"
# TODO(mdan): Remove once the golden files are generated in Python 3.7.
_NORMALIZE_TYPE["<class 'typing._GenericAlias'>"] = 'typing.Union'
if sys.version_info.major == 3 and sys.version_info.minor >= 8: