Skip to content

Commit 3f9f7d3

Browse files
pierrot0The TensorFlow Datasets Authors
authored andcommitted
fix binarized_mnist for NumPy 2.3.
PiperOrigin-RevId: 767949597
1 parent c317c90 commit 3f9f7d3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tensorflow_datasets/datasets/binarized_mnist/binarized_mnist_dataset_builder.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,10 @@ def _generate_examples(self, data_path):
8585
Generator yielding the next examples
8686
"""
8787
with tf.io.gfile.GFile(data_path, "rb") as f:
88-
images = np.loadtxt(f, delimiter=" ", dtype=np.uint8).reshape(
89-
(-1,) + mnist.MNIST_IMAGE_SHAPE
88+
images = (
89+
np.loadtxt(f, delimiter=" ")
90+
.astype(np.uint8)
91+
.reshape((-1,) + mnist.MNIST_IMAGE_SHAPE)
9092
)
9193
for index, image in enumerate(images):
9294
yield index, {"image": image}

0 commit comments

Comments
 (0)