Enable ruff UP031 rule (#11388)

This commit is contained in:
Maxim Smolskiy
2024-04-30 07:40:26 +03:00
committed by GitHub
parent 3925b8155b
commit 2d6be5fbb0
2 changed files with 4 additions and 3 deletions

View File

@ -156,7 +156,8 @@ class _DataSet:
self._rng = np.random.default_rng(seed1 if seed is None else seed2)
dtype = dtypes.as_dtype(dtype).base_dtype
if dtype not in (dtypes.uint8, dtypes.float32):
raise TypeError("Invalid image dtype %r, expected uint8 or float32" % dtype)
msg = f"Invalid image dtype {dtype!r}, expected uint8 or float32"
raise TypeError(msg)
if fake_data:
self._num_examples = 10000
self.one_hot = one_hot