From 097a13a7fb12d2a41780769088e32441e886c2f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tatiana=20Castro-V=C3=A9lez?= Date: Wed, 18 Oct 2023 17:01:03 -0400 Subject: [PATCH] Adressing requested changes in PR --- .../cast/python/ml/test/TestTensorflowModel.java | 13 ++++++------- .../data/tf2_test_model_call.py | 15 +++------------ .../data/tf2_test_model_call2.py | 16 ++++------------ .../data/tf2_test_model_call3.py | 16 ++++------------ .../data/tf2_test_model_call4.py | 16 ++++------------ 5 files changed, 21 insertions(+), 55 deletions(-) diff --git a/com.ibm.wala.cast.python.ml.test/source/com/ibm/wala/cast/python/ml/test/TestTensorflowModel.java b/com.ibm.wala.cast.python.ml.test/source/com/ibm/wala/cast/python/ml/test/TestTensorflowModel.java index b4c187dab..30077d598 100644 --- a/com.ibm.wala.cast.python.ml.test/source/com/ibm/wala/cast/python/ml/test/TestTensorflowModel.java +++ b/com.ibm.wala.cast.python.ml.test/source/com/ibm/wala/cast/python/ml/test/TestTensorflowModel.java @@ -202,24 +202,23 @@ public void testTf2() 0); // NOTE: Change to testTf2("tf2_test_dataset.py", "add", 2, 3, 2, 3) once // https://github.com/wala/ML/issues/89 is fixed. 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); + testTf2("tf2_test_tensor_list2.py", "add", 0, 2); + testTf2("tf2_test_tensor_list3.py", "add", 0, 2); testTf2( "tf2_test_model_call.py", "SequentialModel.__call__", - 0, - 3); // NOTE: Change to testTf2("tf2_test_model_call.py", "SequentialModel.__call__", 1, 5, + 0, 2); // NOTE: Change to testTf2("tf2_test_model_call.py", "SequentialModel.__call__", 1, 4, // 2) once // https://github.com/wala/ML/issues/24 is fixed. testTf2( "tf2_test_model_call2.py", "SequentialModel.call", 0, - 3); // NOTE: Change to testTf2("tf2_test_model_call.py", "SequentialModel.call", 1, 5, 2) + 2); // NOTE: Change to testTf2("tf2_test_model_call.py", "SequentialModel.call", 1, 4, 2) // once // https://github.com/wala/ML/issues/24 is fixed. - testTf2("tf2_test_model_call3.py", "SequentialModel.call", 1, 5, 2); - testTf2("tf2_test_model_call4.py", "SequentialModel.__call__", 1, 5, 2); + testTf2("tf2_test_model_call3.py", "SequentialModel.call", 1, 4, 2); + testTf2("tf2_test_model_call4.py", "SequentialModel.__call__", 1, 4, 2); } private void testTf2( diff --git a/com.ibm.wala.cast.python.test/data/tf2_test_model_call.py b/com.ibm.wala.cast.python.test/data/tf2_test_model_call.py index 864fbb594..466b01491 100644 --- a/com.ibm.wala.cast.python.test/data/tf2_test_model_call.py +++ b/com.ibm.wala.cast.python.test/data/tf2_test_model_call.py @@ -28,16 +28,7 @@ def __call__(self, x): return x +input_data = tf.random.uniform([20, 28, 28]) -if __name__ == '__main__': - input_data = tf.random.uniform([20, 28, 28]) - print("Input:") - print(type(input_data)) - print(input_data) - - model = SequentialModel() - result = model(input_data) - - print("Output:") - print(type(input_data)) - print(result) +model = SequentialModel() +result = model(input_data) diff --git a/com.ibm.wala.cast.python.test/data/tf2_test_model_call2.py b/com.ibm.wala.cast.python.test/data/tf2_test_model_call2.py index 51bc54b41..a097ab50c 100644 --- a/com.ibm.wala.cast.python.test/data/tf2_test_model_call2.py +++ b/com.ibm.wala.cast.python.test/data/tf2_test_model_call2.py @@ -30,15 +30,7 @@ def call(self, x): return x -if __name__ == '__main__': - input_data = tf.random.uniform([20, 28, 28]) - print("Input:") - print(type(input_data)) - print(input_data) - - model = SequentialModel() - result = model(input_data) - - print("Output:") - print(type(input_data)) - print(result) +input_data = tf.random.uniform([20, 28, 28]) + +model = SequentialModel() +result = model(input_data) diff --git a/com.ibm.wala.cast.python.test/data/tf2_test_model_call3.py b/com.ibm.wala.cast.python.test/data/tf2_test_model_call3.py index 215a92069..787516c78 100644 --- a/com.ibm.wala.cast.python.test/data/tf2_test_model_call3.py +++ b/com.ibm.wala.cast.python.test/data/tf2_test_model_call3.py @@ -30,15 +30,7 @@ def call(self, x): return x -if __name__ == '__main__': - input_data = tf.random.uniform([20, 28, 28]) - print("Input:") - print(type(input_data)) - print(input_data) - - model = SequentialModel() - result = model.call(input_data) - - print("Output:") - print(type(input_data)) - print(result) +input_data = tf.random.uniform([20, 28, 28]) + +model = SequentialModel() +result = model.call(input_data) diff --git a/com.ibm.wala.cast.python.test/data/tf2_test_model_call4.py b/com.ibm.wala.cast.python.test/data/tf2_test_model_call4.py index fd7360d33..23a1b4766 100644 --- a/com.ibm.wala.cast.python.test/data/tf2_test_model_call4.py +++ b/com.ibm.wala.cast.python.test/data/tf2_test_model_call4.py @@ -30,15 +30,7 @@ def __call__(self, x): return x -if __name__ == '__main__': - input_data = tf.random.uniform([20, 28, 28]) - print("Input:") - print(type(input_data)) - print(input_data) - - model = SequentialModel() - result = model.__call__(input_data) - - print("Output:") - print(type(input_data)) - print(result) +input_data = tf.random.uniform([20, 28, 28]) + +model = SequentialModel() +result = model.__call__(input_data)