MCPcopy Create free account
hub / github.com/Oneflow-Inc/oneflow / get_numpy

Function get_numpy

python/oneflow/test/tensor/test_tensor_indexing2.py:476–480  ·  view source on GitHub ↗
(tensor, indices)

Source from the content-addressed store, hash-verified

474 return npt, idxs
475
476 def get_numpy(tensor, indices):
477 npt, idxs = tensor_indices_to_np(tensor, indices)
478
479 # index and return as a flow Tensor
480 return flow.tensor(npt[idxs], dtype=dtype, device=device)
481
482 def set_numpy(tensor, indices, value):
483 if not isinstance(value, int):

Callers 3

assert_get_eqFunction · 0.70

Calls 1

tensor_indices_to_npFunction · 0.70

Tested by

no test coverage detected