diff options
Diffstat (limited to 'tensorflow/core/framework/shape_inference.cc')
-rw-r--r-- | tensorflow/core/framework/shape_inference.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tensorflow/core/framework/shape_inference.cc b/tensorflow/core/framework/shape_inference.cc index f30272e250..ee9192d4a1 100644 --- a/tensorflow/core/framework/shape_inference.cc +++ b/tensorflow/core/framework/shape_inference.cc @@ -921,7 +921,7 @@ Status InferenceContext::Add(DimensionHandle first, DimensionOrConstant second, if (first_value == 0) { *out = MakeDim(second); } else if (second_value == 0) { - *out = MakeDim(first); + *out = first; } else if (first_value == kUnknownDim || second_value == kUnknownDim) { *out = UnknownDim(); } else { @@ -946,7 +946,7 @@ Status InferenceContext::Subtract(DimensionHandle first, const int64 second_value = Value(second); // Special cases. if (second_value == 0) { - *out = MakeDim(first); + *out = first; } else if (first_value == kUnknownDim || second_value == kUnknownDim) { *out = UnknownDim(); } else { |