Skip to content
Snippets Groups Projects
Commit fc5a2f7f authored by Cyril Moineau's avatar Cyril Moineau
Browse files

[TensorImpl] Add unit test on get/set methods.

parent c4e63a10
No related branches found
No related tags found
1 merge request!6Tensor setter getter
Pipeline #31782 failed
......@@ -45,5 +45,17 @@ class test_tensor(unittest.TestCase):
self.assertTrue(i_t == i_n) # TODO : May need to change this to a difference
for i,j in zip(t.dims(), np_array.shape):
self.assertEqual(i,j)
def test_get_set(self):
dims = [2,2,2]
np_array = np.arange(8).reshape(dims)
# Numpy -> Tensor
t = aidge_core.Tensor(np_array)
for i in range(8):
self.assertEqual(t[i], i)
t[i] = 5
self.assertEqual(t[i], 5)
if __name__ == '__main__':
unittest.main()
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