From 130539dd89914bdb63250a91fe94a7ddf1fdadbc Mon Sep 17 00:00:00 2001 From: "A. Unique TensorFlower" Date: Tue, 6 Mar 2018 15:20:58 -0800 Subject: [PATCH] Remove clipping on BoundedTensorSpec range. PiperOrigin-RevId: 188089885 --- tensorflow/python/framework/tensor_spec.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/tensorflow/python/framework/tensor_spec.py b/tensorflow/python/framework/tensor_spec.py index a0411bc..27a9ab8 100644 --- a/tensorflow/python/framework/tensor_spec.py +++ b/tensorflow/python/framework/tensor_spec.py @@ -166,16 +166,8 @@ class BoundedTensorSpec(TensorSpec): @classmethod def from_spec(cls, spec): dtype = dtypes.as_dtype(spec.dtype) - if dtype in [dtypes.float64, dtypes.float32]: - # Avoid under/over-flow for `dtype.maximum - dtype.minimum`. - low = dtype.min / 2 - high = dtype.max / 2 - else: - low = dtype.min - high = dtype.max - - minimum = getattr(spec, "minimum", low) - maximum = getattr(spec, "maximum", high) + minimum = getattr(spec, "minimum", dtype.min) + maximum = getattr(spec, "maximum", dtype.max) return BoundedTensorSpec(spec.shape, dtype, minimum, maximum, spec.name) @property -- 2.7.4