Skip to content

Commit aed7147

Browse files
committed
Add assertions.
1 parent e494084 commit aed7147

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

com.ibm.wala.cast.python.test/data/tf2_test_add.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,19 @@ def f(a):
66

77

88
x = [1, 2, 3, 4, 5]
9+
assert isinstance(x, list)
10+
assert all(isinstance(i, int) for i in x)
11+
assert tf.convert_to_tensor(x).dtype == tf.int32
12+
assert tf.convert_to_tensor(x).shape == (5,)
13+
914
y = 1
15+
assert isinstance(y, int)
16+
assert tf.convert_to_tensor(y).dtype == tf.int32
17+
assert tf.convert_to_tensor(y).shape == ()
18+
1019
z = tf.add(x, y)
20+
assert isinstance(z, tf.Tensor)
21+
assert z.dtype == tf.int32
22+
assert z.shape == (5,)
23+
1124
f(z)

0 commit comments

Comments
 (0)