Skip to content

Commit 3f13408

Browse files
author
hhsecond
committed
more tests
1 parent e754a17 commit 3f13408

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

test/test.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,14 @@ def test_set_tensor(self):
4040

4141
def test_numpy_tensor(self):
4242
con = self.get_client()
43-
con.tensorset('x', np.array([2, 3]))
43+
input_array = np.array([2, 3])
44+
con.tensorset('x', input_array)
4445
values = con.tensorget('x').value
4546
self.assertEqual([2, 3], values)
47+
values = con.tensorget('x', as_type=BlobTensor)
48+
self.assertTrue(np.allclose(input_array, values.to_numpy()))
49+
ret = con.tensorset('x', values)
50+
self.assertEqual(ret, b'OK')
4651

4752
def test_run_tf_model(self):
4853
model_path = os.path.join(MODEL_DIR, 'graph.pb')

0 commit comments

Comments
 (0)