diff --git a/mindspore/ccsrc/operator/composite/do_signature.cc b/mindspore/ccsrc/operator/composite/do_signature.cc index dd4d3a87c6ff935c4eaef3394c797fd76e337414..305f07584f69ca6853becbf3132c28b0d33cc22d 100644 --- a/mindspore/ccsrc/operator/composite/do_signature.cc +++ b/mindspore/ccsrc/operator/composite/do_signature.cc @@ -255,9 +255,6 @@ void DoAutoCast(const std::vector &signature, const abstract::Abstrac if (arg_value->isa() && arg_type_id == it->second) { continue; } - if ((arg_type_id == kNumberTypeBool || it->second == kNumberTypeBool) && arg_type_id != it->second) { - continue; - } (*op_inputs)[i + 1] = DoCast((*op_inputs)[i + 1], it->second, graph); } } diff --git a/tests/ut/python/ops/test_math_ops.py b/tests/ut/python/ops/test_math_ops.py index d600ce16b4c8b9ead33efd0760257b9049fcd9c7..e280cc10947b80030f01e2f9872f4de6d393976f 100755 --- a/tests/ut/python/ops/test_math_ops.py +++ b/tests/ut/python/ops/test_math_ops.py @@ -101,10 +101,8 @@ def test_pow(): result = testpow(input_tensor, power) assert np.all(result.asnumpy() == expect) net = PowNet() - with pytest.raises(TypeError): - net(input_tensor, True) - with pytest.raises(TypeError): - net(input_tensor, power2) + net(input_tensor, True) + net(input_tensor, power2) def test_exp(): diff --git a/tests/ut/python/ops/test_math_ops_check.py b/tests/ut/python/ops/test_math_ops_check.py index 355e35f9331ad102c369fa9d94eda4a12fde544f..9772de82e4378b0231a16acb600c338c2e155dc5 100755 --- a/tests/ut/python/ops/test_math_ops_check.py +++ b/tests/ut/python/ops/test_math_ops_check.py @@ -293,13 +293,6 @@ raise_set = [ 'desc_inputs': [5.0], 'skip': ['backward']}), - # input x is Tensor(bool) - ('Pow1', { - 'block': (P.Pow(), - {'exception': TypeError, 'error_keywords': ['Pow']}), - 'desc_inputs': [Tensor(np.ones([2, 3]).astype(np.bool_)), 2.0], - 'skip': ['backward']}), - # input is not Tensor ('Exp1', { 'block': (P.Exp(),