Files
tinygrad/test/null/test_mnist_dataset.py
George Hotz 156a4438d9 rename BUFFER_VIEW to SLICE (#16391)
* rename BUFFER_VIEW to SLICE

* fix comments
2026-05-26 18:15:00 -07:00

15 lines
452 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()
GlobalCounters.reset()
X_train[0].contiguous().realize()
self.assertLessEqual(GlobalCounters.kernel_count, 1) # 0 if SLICE (zero-copy), 1 otherwise
if __name__ == '__main__':
unittest.main()