MCPcopy
hub / github.com/tinygrad/tinygrad / test_dataset_is_realized

Method test_dataset_is_realized

test/null/test_mnist_dataset.py:6–11  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

4
5class TestDataset(unittest.TestCase):
6 def test_dataset_is_realized(self):
7 X_train, _, _, _ = mnist()
8 X_train[0].contiguous().realize()
9 GlobalCounters.reset()
10 X_train[0].contiguous().realize()
11 self.assertLessEqual(GlobalCounters.kernel_count, 1) # 0 if BUFFER_VIEW (zero-copy), 1 otherwise
12
13if __name__ == '__main__':
14 unittest.main()

Callers

nothing calls this directly

Calls 4

mnistFunction · 0.90
realizeMethod · 0.80
contiguousMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected