Skip to content

Commit

Permalink
Add a hybrid dataset test case.
Browse files Browse the repository at this point in the history
  • Loading branch information
khatchad committed Jan 4, 2024
1 parent dcce6f7 commit fec590e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ public void testTf2()
testTf2("tf2_test_dataset4.py", "add", 2, 2, 2, 3);
testTf2("tf2_test_dataset5.py", "add", 2, 2, 2, 3);
testTf2("tf2_test_dataset6.py", "add", 2, 2, 2, 3);
testTf2("tf2_test_dataset7.py", "add", 2, 2, 2, 3);
testTf2("tf2_test_tensor_list.py", "add", 2, 3, 2, 3);
testTf2("tf2_test_tensor_list2.py", "add", 0, 2);
testTf2("tf2_test_tensor_list3.py", "add", 0, 2);
Expand Down
15 changes: 15 additions & 0 deletions com.ibm.wala.cast.python.test/data/tf2_test_dataset7.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import tensorflow as tf


@tf.function
def add(a, b):
return a + b


def func(ds):
for element in ds:
c = add(element, element)


dataset = tf.data.Dataset.from_tensor_slices([1, 2, 3]).shuffle(3).batch(2)
func(dataset)

0 comments on commit fec590e

Please sign in to comment.