From 07cce8eca06ac19657c5ddd68126d938ea54c7c3 Mon Sep 17 00:00:00 2001 From: Raffi Khatchadourian Date: Wed, 11 Oct 2023 14:20:39 -0400 Subject: [PATCH] Additional test case for https://github.com/ponder-lab/Hybridize-Functions-Refactoring/issues/265. Send the entire list. --- .../testHasLikelyTensorParameter146/in/A.py | 10 ++++++++++ .../in/requirements.txt | 1 + .../tests/HybridizeFunctionRefactoringTest.java | 8 ++++++++ 3 files changed, 19 insertions(+) create mode 100644 edu.cuny.hunter.hybridize.tests/resources/HybridizeFunction/testHasLikelyTensorParameter146/in/A.py create mode 100644 edu.cuny.hunter.hybridize.tests/resources/HybridizeFunction/testHasLikelyTensorParameter146/in/requirements.txt diff --git a/edu.cuny.hunter.hybridize.tests/resources/HybridizeFunction/testHasLikelyTensorParameter146/in/A.py b/edu.cuny.hunter.hybridize.tests/resources/HybridizeFunction/testHasLikelyTensorParameter146/in/A.py new file mode 100644 index 000000000..33e191933 --- /dev/null +++ b/edu.cuny.hunter.hybridize.tests/resources/HybridizeFunction/testHasLikelyTensorParameter146/in/A.py @@ -0,0 +1,10 @@ +import tensorflow as tf + + +def add(a, b): + return a + b + + +list = [tf.ones([1, 2]), tf.ones([2, 2])] + +c = add(list, list) diff --git a/edu.cuny.hunter.hybridize.tests/resources/HybridizeFunction/testHasLikelyTensorParameter146/in/requirements.txt b/edu.cuny.hunter.hybridize.tests/resources/HybridizeFunction/testHasLikelyTensorParameter146/in/requirements.txt new file mode 100644 index 000000000..b154f958f --- /dev/null +++ b/edu.cuny.hunter.hybridize.tests/resources/HybridizeFunction/testHasLikelyTensorParameter146/in/requirements.txt @@ -0,0 +1 @@ +tensorflow==2.9.3 diff --git a/edu.cuny.hunter.hybridize.tests/test cases/edu/cuny/hunter/hybridize/tests/HybridizeFunctionRefactoringTest.java b/edu.cuny.hunter.hybridize.tests/test cases/edu/cuny/hunter/hybridize/tests/HybridizeFunctionRefactoringTest.java index 91658e360..58b62482a 100644 --- a/edu.cuny.hunter.hybridize.tests/test cases/edu/cuny/hunter/hybridize/tests/HybridizeFunctionRefactoringTest.java +++ b/edu.cuny.hunter.hybridize.tests/test cases/edu/cuny/hunter/hybridize/tests/HybridizeFunctionRefactoringTest.java @@ -4302,6 +4302,14 @@ public void testHasLikelyTensorParameter145() throws Exception { testHasLikelyTensorParameterHelper(); } + /** + * Test for https://github.com/ponder-lab/Hybridize-Functions-Refactoring/issues/265. + */ + @Test + public void testHasLikelyTensorParameter146() throws Exception { + testHasLikelyTensorParameterHelper(false, false); + } + // TODO: Test arbitrary expression. // TODO: Test cast/assert statements? // TODO: https://www.tensorflow.org/guide/function#pass_tensors_instead_of_python_literals. How do we deal with union types? Do we want