MCPcopy Create free account
hub / github.com/TabbyML/tabby / _to_numpy

Function _to_numpy

python/tests/test_transformers.py:336–343  ·  view source on GitHub ↗
(storage, device)

Source from the content-addressed store, hash-verified

334
335
336def _to_numpy(storage, device):
337 import torch
338
339 return (
340 np.array(storage)
341 if device == "cpu"
342 else torch.as_tensor(storage, device=device).cpu().numpy()
343 )
344
345
346@test_utils.only_on_linux

Callers 1

Calls 1

numpyMethod · 0.45

Tested by

no test coverage detected