MCPcopy
hub / github.com/apache/tvm / test_tensor_from_numpy

Function test_tensor_from_numpy

tests/python/relax/test_frontend_nn_tensor.py:28–34  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

26
27
28def test_tensor_from_numpy():
29 x = np.random.rand(1, 10)
30 tensor_x = Tensor.from_const(x)
31 assert tensor_x.shape == [1, 10]
32 assert tensor_x.ndim == 2
33 assert tensor_x.dtype == "float32"
34 assert repr(tensor_x) == 'Tensor([1, 10], "float32")'
35
36
37def test_tensor_from_scalar():

Callers

nothing calls this directly

Calls 1

from_constMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…