Skip to content

Commit 30b3d47

Browse files
committed
add test for runModel
1 parent 41ba051 commit 30b3d47

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

src/test/java/com/redislabs/redisai/RedisAITest.java

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,17 @@ public void testSetModel() {
3232
// client.getModel("model");
3333
}
3434

35-
// @Test
36-
// public void testRunModel() {
37-
// ClassLoader classLoader = getClass().getClassLoader();
38-
// String model = classLoader.getResource("graph.pb").getFile();
39-
// client.setModel("model", Backend.TF, Device.CPU, new String[] {"input"}, new String[] {"target"}, model);
40-
// client.setTensor("input", new int[]{1}, new int[] {1});
41-
//
42-
// Assert.assertTrue(client.runModel("model", new String[] {"input"}, new String[] {"target"}));
43-
// }
35+
@Test
36+
public void testRunModel() {
37+
ClassLoader classLoader = getClass().getClassLoader();
38+
String model = classLoader.getResource("graph.pb").getFile();
39+
client.setModel("model", Backend.TF, Device.CPU, new String[] {"a", "b"}, new String[] {"mul"}, model);
40+
41+
client.setTensor("a", new float[] {2, 3}, new int[]{2});
42+
client.setTensor("b", new float[] {2, 3}, new int[]{2});
43+
44+
Assert.assertTrue(client.runModel("model", new String[] {"a", "b"}, new String[] {"c"}));
45+
}
4446

4547
@Test
4648
public void testSeScriptFile() {

0 commit comments

Comments
 (0)