Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
hub
/
github.com/tinygrad/tinygrad
/ test_same_dev
Method
test_same_dev
test/backend/test_tensor.py:589–592 ·
view source on GitHub ↗
(self, dev)
Source
from the content-addressed store, hash-verified
587
588
@given(strat.sampled_from([d0, d1]))
589
def
test_same_dev(self, dev):
590
x = Tensor([1,2,3], device=dev)
591
y = x.to(dev)
592
assert x is y
593
594
def
test_to_grad(self):
595
x = Tensor.eye(3, device=self.d0)
Callers
nothing calls this directly
Calls
2
to
Method · 0.95
Tensor
Class · 0.90
Tested by
no test coverage detected