MCPcopy
hub / github.com/tinygrad/tinygrad / create_tiny_mapping

Method create_tiny_mapping

extra/torch_hook/hook_torch.py:44–47  ·  view source on GitHub ↗
(arg)

Source from the content-addressed store, hash-verified

42 return args is None or isinstance(arg, (str, int, float, bool))
43
44 def create_tiny_mapping(arg):
45 if WRAP_TINY:
46 tt = Tensor.from_blob(arg.data_ptr(), arg.shape, dtype=_from_torch_dtype(arg.dtype))
47 cuda_to_tiny_mappings[arg] = tiny_torch.wrap(tt)
48
49 for i,arg in enumerate(args):
50 if torch.is_tensor(arg):

Callers

nothing calls this directly

Calls 3

_from_torch_dtypeFunction · 0.90
from_blobMethod · 0.80
wrapMethod · 0.80

Tested by

no test coverage detected