Files
github-actions[bot] 5c97379765 sunnypilot v2026.003.000 release
date: 2026-08-01T16:05:18
master commit: 3a05c03079d796f533f342489b3f681cfd21f98d
2026-08-01 16:09:01 +08:00

15 lines
458 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 BUFFER_VIEW (zero-copy), 1 otherwise
if __name__ == '__main__':
unittest.main()