MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / test_basic

Method test_basic

test/cinn/test_hlir_framework.py:24–33  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

22
23class TensorTest(unittest.TestCase):
24 def test_basic(self):
25 target = Target()
26 target.arch = Target.X86Arch()
27 target.bits = Target.Bit.k64
28 target.os = Target.OS.Linux
29 tensor = Tensor()
30 data = np.random.random([10, 5])
31 tensor.from_numpy(data, target)
32
33 np.testing.assert_allclose(tensor.numpy(), data)
34
35
36if __name__ == "__main__":

Callers

nothing calls this directly

Calls 5

TargetClass · 0.90
numpyMethod · 0.80
TensorClass · 0.50
randomMethod · 0.45
from_numpyMethod · 0.45

Tested by

no test coverage detected