MCPcopy
hub / github.com/tinygrad/tinygrad / test_size_change_buffer_view

Method test_size_change_buffer_view

test/null/test_schedule.py:118–121  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

116 check_schedule(b, 1)
117
118 def test_size_change_buffer_view(self):
119 a = Tensor.empty(4)
120 b = a.reshape((1, 1, 4)).shrink(((0, 1), (0, 1), (0, 3))).contiguous()
121 check_schedule(b, 0) # contiguous shrink of a realized buffer is a zero-copy BUFFER_VIEW
122
123 def test_double_contiguous_realizes_once(self):
124 a = Tensor.empty(4, 1)

Callers

nothing calls this directly

Calls 5

shrinkMethod · 0.80
reshapeMethod · 0.80
check_scheduleFunction · 0.70
emptyMethod · 0.45
contiguousMethod · 0.45

Tested by

no test coverage detected