Skip to content

Commit 61e6617

Browse files
committed
Use constant for dtype in tests.
1 parent 4a60ffd commit 61e6617

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

com.ibm.wala.cast.python.ml.test/source/com/ibm/wala/cast/python/ml/test/TestTensorflow2Model.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.ibm.wala.cast.python.ml.test;
22

3+
import static com.ibm.wala.cast.python.ml.types.TensorFlowTypes.DType.FLOAT32;
34
import static com.ibm.wala.cast.python.ml.types.TensorType.mnistInput;
45
import static com.ibm.wala.cast.python.util.Util.addPytestEntrypoints;
56
import static java.util.Arrays.asList;
@@ -58,6 +59,8 @@ public class TestTensorflow2Model extends TestPythonMLCallGraphShape {
5859

5960
private static final TensorType MNIST_INPUT = mnistInput();
6061

62+
private static final String FLOAT_32 = FLOAT32.name().toLowerCase();
63+
6164
@Test
6265
public void testValueIndex()
6366
throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException {
@@ -880,8 +883,8 @@ public void testAdd7()
880883

881884
List<Dimension<?>> bDimensions = asList(bX, bY);
882885

883-
TensorType expectedTypeForA = new TensorType("pixel", aDimensions);
884-
TensorType expectedTypeForB = new TensorType("pixel", bDimensions);
886+
TensorType expectedTypeForA = new TensorType(FLOAT_32, aDimensions);
887+
TensorType expectedTypeForB = new TensorType(FLOAT_32, bDimensions);
885888

886889
test(
887890
"tf2_test_add7.py",
@@ -1564,8 +1567,8 @@ public void testAdd116()
15641567

15651568
List<Dimension<?>> bDimensions = asList(bX, bY);
15661569

1567-
TensorType expectedTypeForA = new TensorType("pixel", aDimensions);
1568-
TensorType expectedTypeForB = new TensorType("pixel", bDimensions);
1570+
TensorType expectedTypeForA = new TensorType(FLOAT_32, aDimensions);
1571+
TensorType expectedTypeForB = new TensorType(FLOAT_32, bDimensions);
15691572

15701573
test(
15711574
"tf2_test_add116.py",

0 commit comments

Comments
 (0)