MCPcopy Create free account
hub / github.com/apache/tvm / _tvm_to_numpy

Function _tvm_to_numpy

tests/python/relax/test_op_gradient_numeric.py:93–98  ·  view source on GitHub ↗
(data, ignore_idx=[])

Source from the content-addressed store, hash-verified

91 return tvm.runtime.tensor(data)
92
93 def _tvm_to_numpy(data, ignore_idx=[]):
94 if isinstance(data, tvm_ffi.Array):
95 return [_tvm_to_numpy(d) for i, d in enumerate(data) if i not in ignore_idx]
96 if isinstance(data, tvm.runtime.Tensor):
97 return data.numpy()
98 return data
99
100 def _gen_weights(out_sinfo):
101 if isinstance(out_sinfo, TupleStructInfo):

Callers 2

forwardFunction · 0.70
relax_check_gradientsFunction · 0.70

Calls 1

numpyMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…