提交 850d5c0f 编写于 作者: M Mihai Maruseac

Fix conflict resolution error

Signed-off-by: NMihai Maruseac <mihaimaruseac@google.com>
上级 646ebe5c
...@@ -428,6 +428,14 @@ class QuantizeAndDequantizeV3OpTest(test_util.TensorFlowTestCase): ...@@ -428,6 +428,14 @@ class QuantizeAndDequantizeV3OpTest(test_util.TensorFlowTestCase):
input=inputs, input_min=[], input_max=4.0, input=inputs, input_min=[], input_max=4.0,
out_type=dtypes.quint8)) out_type=dtypes.quint8))
input_value = constant_op.constant([-0.8, -0.5, 0, 0.3, 0.8, -2.0],
shape=(6,),
dtype=dtypes.float32),
input_min = constant_op.constant(-127, shape=(), dtype=dtypes.float32)
input_max = constant_op.constant(127, shape=(), dtype=dtypes.float32)
# Tensor with invalid shape and invalid number of elements.
num_bits = constant_op.constant([], shape=(0,), dtype=dtypes.int32)
# Test that running the op raises error. It raises different errors # Test that running the op raises error. It raises different errors
# depending on whether the shape inference is run first or the op's # depending on whether the shape inference is run first or the op's
# Compute() is run first. # Compute() is run first.
...@@ -454,13 +462,16 @@ class QuantizeDownAndShrinkRangeOpTest(test_util.TensorFlowTestCase): ...@@ -454,13 +462,16 @@ class QuantizeDownAndShrinkRangeOpTest(test_util.TensorFlowTestCase):
@test_util.run_in_graph_and_eager_modes @test_util.run_in_graph_and_eager_modes
def test_invalid_inputs(self): def test_invalid_inputs(self):
input_value = constant_op.constant([-0.8, -0.5, 0, 0.3, 0.8, -2.0], inputs = constant_op.constant(
shape=(6,), np.int32(0), shape=[3, 3, 3, 3], dtype=dtypes.qint32)
dtype=dtypes.float32),
input_min = constant_op.constant(-127, shape=(), dtype=dtypes.float32) with self.assertRaisesRegex((ValueError, errors.InvalidArgumentError),
input_max = constant_op.constant(127, shape=(), dtype=dtypes.float32) "must be rank 0"):
# Tensor with invalid shape and invalid number of elements. self.evaluate(
num_bits = constant_op.constant([], shape=(0,), dtype=dtypes.int32) math_ops.quantize_down_and_shrink_range(input=inputs,
input_min=[],
input_max=4.0,
out_type=dtypes.quint8))
if __name__ == "__main__": if __name__ == "__main__":
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册