Skip to content

Commit

Permalink
Another list test, this one with tensors.
Browse files Browse the repository at this point in the history
Similar to the third list test but given a sequence in the ctor.
  • Loading branch information
khatchad committed Dec 15, 2023
1 parent e2b71cb commit 243cae2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ public void testTf2()
testTf2("tf2_test_tensor_list2.py", "add", 0, 2);
testTf2("tf2_test_tensor_list3.py", "add", 0, 2);
testTf2("tf2_test_tensor_list4.py", "add", 0, 0);
testTf2("tf2_test_tensor_list5.py", "add", 0, 2);
testTf2("tf2_test_model_call.py", "SequentialModel.__call__", 1, 4, 3);
testTf2("tf2_test_model_call2.py", "SequentialModel.call", 1, 4, 3);
testTf2("tf2_test_model_call3.py", "SequentialModel.call", 1, 4, 3);
Expand Down
11 changes: 11 additions & 0 deletions com.ibm.wala.cast.python.test/data/tf2_test_tensor_list5.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import tensorflow as tf


def add(a, b):
return a + b


my_list = list([tf.ones([1, 2]), tf.ones([2, 2])])

for element in my_list:
c = add(element, element)

0 comments on commit 243cae2

Please sign in to comment.