Skip to content
Snippets Groups Projects
Commit 625837d2 authored by laurent soulier's avatar laurent soulier
Browse files

[UT] moving tensor test to backend has the implemented test actually requires...

[UT] moving tensor test to backend has the implemented test actually requires some tensor implementation
parent 908ce0f9
No related branches found
No related tags found
No related merge requests found
......@@ -24,6 +24,7 @@ class test_tensor(unittest.TestCase):
self.assertTrue(i_t == i_n)
for i,j in zip(t.dims(), np_array.shape):
self.assertEqual(i,j)
def test_tensor_int_to_numpy(self):
np_array = np.arange(9).reshape(1,1,3,3)
# Numpy -> Tensor
......@@ -46,6 +47,18 @@ class test_tensor(unittest.TestCase):
for i,j in zip(t.dims(), np_array.shape):
self.assertEqual(i,j)
def test_getcoord_getidx(self):
dims = [2,2,2]
size = reduce((lambda x, y: x*y), dims)
np_array = np.arange(size).reshape(dims)
t = aidge_core.Tensor(np_array)
for i in range(size):
coord = t.get_coord(i)
idx = t.get_idx(coord)
self.assertEqual(idx, i)
def test_get_set(self):
dims = [2,2,2]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment