MCPcopy
hub / github.com/tinygrad/tinygrad / test_tensor_from_multi

Method test_tensor_from_multi

test/backend/test_multitensor.py:114–121  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

112 X.shard_(devices_3, 0)
113
114 def test_tensor_from_multi(self):
115 X = Tensor([1, 2], dtype=dtypes.int).shard_(devices_2, 0)
116 Y = Tensor(X.uop)
117 self.assertEqual(Y.device, devices_2)
118 np.testing.assert_equal(X.numpy(), Y.numpy())
119
120 with self.assertRaises(AssertionError):
121 _ = Tensor(X.uop, dtype=dtypes.float)
122
123 def test_sharded_arange(self):
124 sharded_arange = Tensor.arange(1000).clone().shard(devices_2, 0)

Callers

nothing calls this directly

Calls 5

numpyMethod · 0.95
TensorClass · 0.90
shard_Method · 0.80
assert_equalMethod · 0.80
numpyMethod · 0.45

Tested by

no test coverage detected