MCPcopy
hub / github.com/tinygrad/tinygrad / test_stack_slice

Method test_stack_slice

test/backend/test_ops.py:2034–2037  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2032 lambda x: x.pad(((3,2),(0,1),(1,1)), value=value)[2:4,:,:])
2033
2034 def test_stack_slice(self):
2035 helper_test_op([(4)], lambda x: torch.stack([x for i in range(3)])[0,:], lambda x: Tensor.stack(*[x for i in range(3)])[0,:])
2036 helper_test_op([(5)], lambda x: torch.stack([x for i in range(3)])[0,0], lambda x: Tensor.stack(*[x for i in range(3)])[0,0])
2037 helper_test_op([(4,4)], lambda x: torch.stack([x for i in range(4)])[3], lambda x: Tensor.stack(*[x for i in range(4)])[3])
2038
2039 def test_transpose(self):
2040 helper_test_op([(3,3)], lambda x: x.T)

Callers

nothing calls this directly

Calls 2

helper_test_opFunction · 0.85
stackMethod · 0.80

Tested by

no test coverage detected