From 1a0a721c50872f4907412e5e5216032356d44193 Mon Sep 17 00:00:00 2001 From: Raffi Khatchadourian Date: Wed, 8 May 2024 13:12:14 -0400 Subject: [PATCH] Add test. --- .../cast/python/ml/test/TestTensorflow2Model.java | 5 +++++ .../data/tf2_test_reshape.py | 12 ++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 com.ibm.wala.cast.python.test/data/tf2_test_reshape.py diff --git a/com.ibm.wala.cast.python.ml.test/source/com/ibm/wala/cast/python/ml/test/TestTensorflow2Model.java b/com.ibm.wala.cast.python.ml.test/source/com/ibm/wala/cast/python/ml/test/TestTensorflow2Model.java index 79f910cd..55ffea42 100644 --- a/com.ibm.wala.cast.python.ml.test/source/com/ibm/wala/cast/python/ml/test/TestTensorflow2Model.java +++ b/com.ibm.wala.cast.python.ml.test/source/com/ibm/wala/cast/python/ml/test/TestTensorflow2Model.java @@ -3609,6 +3609,11 @@ public void testClassMethod5() throws ClassHierarchyException, CancelException, expectedTensorParameterValueNumbers); } + @Test + public void testReshape() throws ClassHierarchyException, CancelException, IOException { + test("tf2_test_reshape.py", "f", 1, 1, 2); + } + private void test( String filename, String functionName, diff --git a/com.ibm.wala.cast.python.test/data/tf2_test_reshape.py b/com.ibm.wala.cast.python.test/data/tf2_test_reshape.py new file mode 100644 index 00000000..bf23003d --- /dev/null +++ b/com.ibm.wala.cast.python.test/data/tf2_test_reshape.py @@ -0,0 +1,12 @@ +# https://www.tensorflow.org/versions/r2.9/api_docs/python/tf/reshape + +import tensorflow as tf + + +def f(a): + pass + + +t1 = tf.ones([2, 3]) +t2 = tf.reshape(t1, [6]) +f(t2)