MCPcopy Create free account
hub / github.com/NVIDIA/TensorRT / test_numpy

Method test_numpy

tools/Polygraphy/tests/cuda/test_cuda.py:49–54  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

47 assert np.all(host_buf == 4)
48
49 def test_numpy(self):
50 with DeviceArray((2, 2), dtype=np.float32) as arr:
51 arr.copy_from(np.ones((2, 2), dtype=np.float32) * 4)
52
53 v = DeviceView(arr.ptr, arr.shape, arr.dtype)
54 assert np.all(v.numpy() == 4)
55
56
57class ResizeTestCase:

Callers

nothing calls this directly

Calls 4

numpyMethod · 0.95
DeviceArrayClass · 0.90
DeviceViewClass · 0.90
copy_fromMethod · 0.80

Tested by

no test coverage detected