MCPcopy
hub / github.com/tinygrad/tinygrad / copy

Method copy

test/backend/test_jit.py:717–719  ·  view source on GitHub ↗
(self, device, to_device, inp)

Source from the content-addressed store, hash-verified

715 return (inp + 1.0).contiguous().realize()
716
717 def copy(self, device, to_device, inp):
718 assert inp.device == device, f"Input device {inp.device} does not match expected {device}"
719 return inp.to(to_device).realize()
720
721 def expect(self, f, *args, graph=None, multigraph=None, hcqgraph=None):
722 def _numpies(tpl): return tpl.numpy() if tpl.__class__ is Tensor else tuple([t.numpy() for t in tpl])

Callers 15

fMethod · 0.95
set_dataMethod · 0.45
__init__Method · 0.45
__init__Method · 0.45
test_duped_weightsMethod · 0.45
test_lamb_cpu_offloadMethod · 0.45

Calls 2

realizeMethod · 0.80
toMethod · 0.45

Tested by

no test coverage detected