!37309 fix implicitly converted error log for master
Merge pull request !37309 from chujinjin/fix_error_log_for_master
This commit is contained in:
commit
ff86996b45
|
@ -1863,8 +1863,8 @@ void ForwardExecutor::DoSignatureCast(const PrimitivePyPtr &prim,
|
|||
}
|
||||
|
||||
if (IsPyObjTypeInvalid(obj)) {
|
||||
MS_EXCEPTION(TypeError) << "For '" << prim->name() << "', the " << i << "th input " << signature[i].name
|
||||
<< " is a not support implicit conversion. "
|
||||
MS_EXCEPTION(TypeError) << "For '" << prim->name() << "', the " << (i + 1) << "th input " << signature[i].name
|
||||
<< " can not be implicitly converted. "
|
||||
<< "Its type is " << py::cast<std::string>(obj.attr("__class__").attr("__name__"))
|
||||
<< ", and the value is " << py::cast<py::str>(obj) << ". Only support Tensor or Scalar.";
|
||||
}
|
||||
|
|
|
@ -111,7 +111,7 @@ def test_float_tensor_and_str_add():
|
|||
y = "ok"
|
||||
with pytest.raises(TypeError) as er:
|
||||
ret = x + y
|
||||
assert "For 'Add', the 1th input var is a not support implicit conversion. Its type is" in str(er.value)
|
||||
assert "For 'Add', the 2th input var can not be implicitly converted. Its type is" in str(er.value)
|
||||
|
||||
|
||||
def test_float_tensor_and_tuple_add():
|
||||
|
|
Loading…
Reference in New Issue