Skip to content

Commit

Permalink
Adressing requested changes in PR
Browse files Browse the repository at this point in the history
  • Loading branch information
tatianacv committed Oct 18, 2023
1 parent a95bb4e commit 097a13a
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 55 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
15 changes: 3 additions & 12 deletions com.ibm.wala.cast.python.test/data/tf2_test_model_call.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
16 changes: 4 additions & 12 deletions com.ibm.wala.cast.python.test/data/tf2_test_model_call2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
16 changes: 4 additions & 12 deletions com.ibm.wala.cast.python.test/data/tf2_test_model_call3.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
16 changes: 4 additions & 12 deletions com.ibm.wala.cast.python.test/data/tf2_test_model_call4.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 097a13a

Please sign in to comment.