Files
tinygrad/test/null/test_mnist_dataset.py
George Hotz dc77b3318b move files that pass with NULL=1 to test/null (#14508)
* move files that pass with NULL=1 to test/null

* fix windows

* cpu 0

* bugfix + durations
2026-02-03 13:52:36 +08:00

15 lines
428 B
Python

import unittest
from tinygrad.helpers import GlobalCounters
from tinygrad.nn.datasets import mnist
class TestDataset(unittest.TestCase):
def test_dataset_is_realized(self):
X_train, _, _, _ = mnist()
X_train[0].contiguous().realize()
start = GlobalCounters.kernel_count
X_train[0].contiguous().realize()
self.assertEqual(GlobalCounters.kernel_count-start, 1)
if __name__ == '__main__':
unittest.main()