Fixes malformatted error string in dtypes.cc

Before
>tf.DType(0)
*** TypeError: %d does not correspond to a valid tensorflow::DataType

After
>tf.DType(0)
*** TypeError: 0 does not correspond to a valid tensorflow::DataType

PiperOrigin-RevId: 340888529
Change-Id: I9c46f9fda798853ed9e9ff3b8c0d7296e896a675
This commit is contained in:
Maxwell Bileschi 2020-11-05 11:05:52 -08:00 committed by TensorFlower Gardener
parent 328a2bdc8b
commit 6c0f333a16

View File

@ -68,7 +68,7 @@ PYBIND11_MODULE(_dtypes, m) {
return static_cast<tensorflow::DataType>(id);
}
throw py::type_error(
py::str("%d does not correspond to a valid tensorflow::DataType")
py::str("{} does not correspond to a valid tensorflow::DataType")
.format(id));
}))
// For compatibility with pure-Python DType.