-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extract tf.function decorator keyword arguments #144
Open
tatianacv
wants to merge
78
commits into
ponder-lab:main
Choose a base branch
from
tatianacv:136-extract-tffunction-decorator-arguments
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 74 commits
Commits
Show all changes
78 commits
Select commit
Hold shift + click to select a range
39c7fb5
update
tatianacv f21e423
progress
tatianacv 747d5c5
Progress
tatianacv 8f8c0b1
Progress
tatianacv 4ffa27a
Progress
tatianacv 21a8004
Progress
tatianacv 89e4dd0
Progress
tatianacv b6f4e9c
Progress
tatianacv b9c8107
adding more testing
tatianacv d6b110c
Fixing trailing whitespace of tests
tatianacv 26fd8f1
Fix to test
tatianacv 9a4cb62
adding other params
tatianacv d0d0875
Progress
tatianacv 015965a
Modifying test resource
tatianacv 6102351
Modifying test resource
tatianacv a62af55
Renaming variable
tatianacv f7a9373
Formatting
tatianacv c9ee308
Adding exceptions
tatianacv 0ab5892
Add more info to exception
tatianacv db5147f
Adding new line to test resource
tatianacv b9bd9be
Restructuring exceptions
tatianacv 9db5396
Adding new line to test resource
tatianacv ec84857
Fixing variable name
tatianacv 74b4bc4
Progress
tatianacv e12fb16
Removing unnecessary else
tatianacv 7aef65b
Progress
tatianacv 9f49fea
Update
tatianacv 279089b
Progress
tatianacv ef5d5bb
Progress
tatianacv 64bd2b6
progress
tatianacv f53e997
Progress
tatianacv 1df7219
Cleanup
tatianacv 1b2ac89
making sure we are only checking literals
tatianacv c4184d4
Reorganization
tatianacv d2ae4c9
Renaming
tatianacv b48960d
Adding documentation
tatianacv 1eb7274
Adding a test where there should be an exception
tatianacv 9195db7
Formatting
tatianacv eba9736
Test
tatianacv dd82611
Revert "Test"
tatianacv df97664
Update
tatianacv 54d78be
Adding new tests
tatianacv 10cb16b
Removing unnecesary files, and adding new line
tatianacv 303a117
Adding newline
tatianacv fc90f50
Update
tatianacv ecffbc5
Adding more tests
tatianacv 3577a39
Trailing whitespace fix
tatianacv 0c72e7d
Adding comments
tatianacv 94733e6
Make sure we are dealing with TensorSpec (input_signature)
tatianacv 41bfe8d
Revert "Make sure we are dealing with TensorSpec (input_signature)"
tatianacv 9003639
Revert "Revert "Make sure we are dealing with TensorSpec (input_signa…
tatianacv 6fd42b2
Fix build
tatianacv 1682088
Adding comments
tatianacv 02ef49b
Merge branch 'main' into 136-extract-tffunction-decorator-arguments
tatianacv ece2522
Update
tatianacv 93f4e9c
Restructuring
tatianacv af61fe5
Restructure
tatianacv 247e1d6
Restructure
tatianacv 9b764d9
Remove redundancy
tatianacv bc3ff06
Restructuring
tatianacv cb23e2f
Adding more information
tatianacv 79d0ff3
update
tatianacv 2c93c3f
Merge branch 'main' into 136-extract-tffunction-decorator-arguments
tatianacv e690e4f
Merge branch 'main' into 136-extract-tffunction-decorator-arguments
khatchad bc534a4
Merge branch 'main' into 136-extract-tffunction-decorator-arguments
tatianacv 9163368
Fixing asserts
tatianacv 09d52cb
Merge branch 'main' into 136-extract-tffunction-decorator-arguments
tatianacv d845f0a
Progress
tatianacv 6a13a5e
progress
tatianacv 4c79a5a
Progress
tatianacv 720bba7
Merge branch '136-extract-tffunction-decorator-arguments' of https://…
tatianacv 5d63094
Changing dtype
tatianacv 0c345f0
fixing comments
tatianacv 44b8b7b
Merge branch 'main' into 136-extract-tffunction-decorator-arguments
khatchad c5b576b
Merge branch 'main' into 136-extract-tffunction-decorator-arguments
tatianacv f2238cf
Remove unnecessary comments, update comments, change tensorspecs shap…
tatianacv 45bcfd2
Adding another test
tatianacv a8ddc42
remove file
tatianacv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
506 changes: 454 additions & 52 deletions
506
edu.cuny.hunter.hybridize.core/src/edu/cuny/hunter/hybridize/core/analysis/Function.java
Large diffs are not rendered by default.
Oops, something went wrong.
90 changes: 90 additions & 0 deletions
90
edu.cuny.hunter.hybridize.core/src/edu/cuny/hunter/hybridize/core/analysis/TensorSpec.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
package edu.cuny.hunter.hybridize.core.analysis; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
import java.util.Objects; | ||
|
||
/** | ||
* A representation of a tf.Tensorspec which describes a tf.Tensor | ||
*/ | ||
public class TensorSpec { | ||
|
||
public enum Dtype { | ||
float16, float32, float64, int32, int64, uint8, uint16, uint32, uint64, int16, int8, complex64, complex128, string, bool, qint8, | ||
quint8, qint16, quint16, qint32, bfloat16, half, resource, variant | ||
} | ||
|
||
/** | ||
* Shape of the tensor being described by {@link TensorSpec}. | ||
*/ | ||
private List<Integer> shape; | ||
|
||
/** | ||
* Type of the tensor being described by {@link TensorSpec}. | ||
*/ | ||
private Dtype dtype; | ||
|
||
public TensorSpec() { | ||
// Initialize to empty list | ||
this.shape = new ArrayList<>(); | ||
this.dtype = Dtype.float32; | ||
} | ||
|
||
public TensorSpec(List<Integer> s, Dtype d) { | ||
this.shape = s; | ||
this.dtype = d; | ||
} | ||
|
||
/** | ||
* Shape of {@link TensorSpec}. | ||
* | ||
* @return List of dimensions (null if the shape is unspecified) of this {@link TensorSpec} shape. | ||
*/ | ||
public List<Integer> getShape() { | ||
return this.shape; | ||
} | ||
|
||
/** | ||
* Dtype of {@link TensorSpec}. | ||
* | ||
* @return Dtype of this {@link TensorSpec} dtype. | ||
*/ | ||
public Dtype getDType() { | ||
return this.dtype; | ||
} | ||
|
||
/** | ||
* Set shape of {@link TensorSpec}. | ||
*/ | ||
public void setShape(List<Integer> s) { | ||
this.shape = s; | ||
} | ||
|
||
/** | ||
* Set dtype of {@link TensorSpec}. | ||
*/ | ||
public void setDType(Dtype d) { | ||
this.dtype = d; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(shape, dtype); | ||
} | ||
|
||
@Override | ||
public boolean equals(Object tensorObject) { | ||
|
||
if (tensorObject == this) { | ||
return true; | ||
} | ||
|
||
if (!(tensorObject instanceof TensorSpec)) { | ||
return false; | ||
} | ||
|
||
TensorSpec tensor = (TensorSpec) tensorObject; | ||
|
||
return shape.equals(tensor.shape) && dtype.equals(tensor.dtype); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
edu.cuny.hunter.hybridize.tests/resources/HybridizeFunction/testDecoratorArguments/in/A.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import tensorflow as tf | ||
|
||
|
||
@tf.function(input_signature=None) | ||
def func(x): | ||
return x | ||
|
||
|
||
if __name__ == '__main__': | ||
number = tf.constant([1.0, 1.0]) | ||
func(number) |
1 change: 1 addition & 0 deletions
1
...er.hybridize.tests/resources/HybridizeFunction/testDecoratorArguments/in/requirements.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
tensorflow==2.9.3 |
10 changes: 10 additions & 0 deletions
10
edu.cuny.hunter.hybridize.tests/resources/HybridizeFunction/testDecoratorArguments10/in/A.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import tensorflow as tf | ||
|
||
|
||
@tf.function(jit_compile=None) | ||
def func(): | ||
pass | ||
|
||
|
||
if __name__ == '__main__': | ||
func() |
1 change: 1 addition & 0 deletions
1
....hybridize.tests/resources/HybridizeFunction/testDecoratorArguments10/in/requirements.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
tensorflow==2.9.3 |
10 changes: 10 additions & 0 deletions
10
edu.cuny.hunter.hybridize.tests/resources/HybridizeFunction/testDecoratorArguments11/in/A.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import tensorflow as tf | ||
|
||
|
||
@tf.function(reduce_retracing=True) | ||
def func(): | ||
pass | ||
|
||
|
||
if __name__ == '__main__': | ||
func() |
1 change: 1 addition & 0 deletions
1
....hybridize.tests/resources/HybridizeFunction/testDecoratorArguments11/in/requirements.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
tensorflow==2.9.3 |
10 changes: 10 additions & 0 deletions
10
edu.cuny.hunter.hybridize.tests/resources/HybridizeFunction/testDecoratorArguments12/in/A.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import tensorflow as tf | ||
|
||
|
||
@tf.function(reduce_retracing=False) | ||
def func(): | ||
pass | ||
|
||
|
||
if __name__ == '__main__': | ||
func() |
1 change: 1 addition & 0 deletions
1
....hybridize.tests/resources/HybridizeFunction/testDecoratorArguments12/in/requirements.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
tensorflow==2.9.3 |
10 changes: 10 additions & 0 deletions
10
edu.cuny.hunter.hybridize.tests/resources/HybridizeFunction/testDecoratorArguments13/in/A.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import tensorflow as tf | ||
|
||
|
||
@tf.function(experimental_implements="google.matmul_low_rank_matrix") | ||
def func(): | ||
pass | ||
|
||
|
||
if __name__ == '__main__': | ||
func() |
1 change: 1 addition & 0 deletions
1
....hybridize.tests/resources/HybridizeFunction/testDecoratorArguments13/in/requirements.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
tensorflow==2.9.3 |
10 changes: 10 additions & 0 deletions
10
edu.cuny.hunter.hybridize.tests/resources/HybridizeFunction/testDecoratorArguments14/in/A.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import tensorflow as tf | ||
|
||
|
||
@tf.function(experimental_implements="embedded_matmul") | ||
def func(): | ||
pass | ||
|
||
|
||
if __name__ == '__main__': | ||
func() |
1 change: 1 addition & 0 deletions
1
....hybridize.tests/resources/HybridizeFunction/testDecoratorArguments14/in/requirements.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
tensorflow==2.9.3 |
10 changes: 10 additions & 0 deletions
10
edu.cuny.hunter.hybridize.tests/resources/HybridizeFunction/testDecoratorArguments15/in/A.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import tensorflow as tf | ||
|
||
|
||
@tf.function(experimental_implements=None) | ||
def func(): | ||
pass | ||
|
||
|
||
if __name__ == '__main__': | ||
func() |
1 change: 1 addition & 0 deletions
1
....hybridize.tests/resources/HybridizeFunction/testDecoratorArguments15/in/requirements.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
tensorflow==2.9.3 |
10 changes: 10 additions & 0 deletions
10
edu.cuny.hunter.hybridize.tests/resources/HybridizeFunction/testDecoratorArguments16/in/A.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import tensorflow as tf | ||
|
||
|
||
@tf.function(experimental_autograph_options=tf.autograph.experimental.Feature.EQUALITY_OPERATORS) | ||
def func(): | ||
pass | ||
|
||
|
||
if __name__ == '__main__': | ||
func() |
1 change: 1 addition & 0 deletions
1
....hybridize.tests/resources/HybridizeFunction/testDecoratorArguments16/in/requirements.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
tensorflow==2.9.3 |
10 changes: 10 additions & 0 deletions
10
edu.cuny.hunter.hybridize.tests/resources/HybridizeFunction/testDecoratorArguments17/in/A.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import tensorflow as tf | ||
|
||
|
||
@tf.function(experimental_autograph_options=tf.autograph.experimental.Feature.ALL) | ||
def func(): | ||
pass | ||
|
||
|
||
if __name__ == '__main__': | ||
func() |
1 change: 1 addition & 0 deletions
1
....hybridize.tests/resources/HybridizeFunction/testDecoratorArguments17/in/requirements.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
tensorflow==2.9.3 |
10 changes: 10 additions & 0 deletions
10
edu.cuny.hunter.hybridize.tests/resources/HybridizeFunction/testDecoratorArguments18/in/A.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import tensorflow as tf | ||
|
||
|
||
@tf.function(experimental_autograph_options=(tf.autograph.experimental.Feature.EQUALITY_OPERATORS, tf.autograph.experimental.Feature.BUILTIN_FUNCTIONS)) | ||
def func(): | ||
pass | ||
|
||
|
||
if __name__ == '__main__': | ||
func() |
1 change: 1 addition & 0 deletions
1
....hybridize.tests/resources/HybridizeFunction/testDecoratorArguments18/in/requirements.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
tensorflow==2.9.3 |
10 changes: 10 additions & 0 deletions
10
edu.cuny.hunter.hybridize.tests/resources/HybridizeFunction/testDecoratorArguments19/in/A.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import tensorflow as tf | ||
|
||
|
||
@tf.function(experimental_autograph_options=None) | ||
def func(): | ||
pass | ||
|
||
|
||
if __name__ == '__main__': | ||
func() |
1 change: 1 addition & 0 deletions
1
....hybridize.tests/resources/HybridizeFunction/testDecoratorArguments19/in/requirements.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
tensorflow==2.9.3 |
10 changes: 10 additions & 0 deletions
10
edu.cuny.hunter.hybridize.tests/resources/HybridizeFunction/testDecoratorArguments2/in/A.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import tensorflow as tf | ||
|
||
|
||
@tf.function(input_signature=(tf.TensorSpec(shape=[None], dtype=tf.float32),)) | ||
def func(x): | ||
return x | ||
|
||
if __name__ == '__main__': | ||
number = tf.constant([1.0, 1.0]) | ||
func(number) |
1 change: 1 addition & 0 deletions
1
...r.hybridize.tests/resources/HybridizeFunction/testDecoratorArguments2/in/requirements.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
tensorflow==2.9.3 |
10 changes: 10 additions & 0 deletions
10
edu.cuny.hunter.hybridize.tests/resources/HybridizeFunction/testDecoratorArguments20/in/A.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import tensorflow as tf | ||
|
||
|
||
@tf.function(experimental_follow_type_hints=True) | ||
def func(): | ||
pass | ||
|
||
|
||
if __name__ == '__main__': | ||
func() |
1 change: 1 addition & 0 deletions
1
....hybridize.tests/resources/HybridizeFunction/testDecoratorArguments20/in/requirements.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
tensorflow==2.9.3 |
10 changes: 10 additions & 0 deletions
10
edu.cuny.hunter.hybridize.tests/resources/HybridizeFunction/testDecoratorArguments21/in/A.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import tensorflow as tf | ||
|
||
|
||
@tf.function(experimental_follow_type_hints=False) | ||
def func(): | ||
pass | ||
|
||
|
||
if __name__ == '__main__': | ||
func() |
1 change: 1 addition & 0 deletions
1
....hybridize.tests/resources/HybridizeFunction/testDecoratorArguments21/in/requirements.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
tensorflow==2.9.3 |
10 changes: 10 additions & 0 deletions
10
edu.cuny.hunter.hybridize.tests/resources/HybridizeFunction/testDecoratorArguments22/in/A.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import tensorflow as tf | ||
|
||
|
||
@tf.function(experimental_follow_type_hints=None) | ||
def func(): | ||
pass | ||
|
||
|
||
if __name__ == '__main__': | ||
func() |
1 change: 1 addition & 0 deletions
1
....hybridize.tests/resources/HybridizeFunction/testDecoratorArguments22/in/requirements.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
tensorflow==2.9.3 |
10 changes: 10 additions & 0 deletions
10
edu.cuny.hunter.hybridize.tests/resources/HybridizeFunction/testDecoratorArguments23/in/A.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import tensorflow as tf | ||
|
||
|
||
@tf.function | ||
def func(): | ||
pass | ||
|
||
|
||
if __name__ == '__main__': | ||
func() |
1 change: 1 addition & 0 deletions
1
....hybridize.tests/resources/HybridizeFunction/testDecoratorArguments23/in/requirements.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
tensorflow==2.9.3 |
12 changes: 12 additions & 0 deletions
12
edu.cuny.hunter.hybridize.tests/resources/HybridizeFunction/testDecoratorArguments24/in/A.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import tensorflow as tf | ||
|
||
|
||
@tf.function(input_signature=(tf.TensorSpec(shape=[None], dtype=tf.float32),), autograph=False) | ||
def func(x): | ||
print('Tracing with', x) | ||
return x | ||
|
||
|
||
if __name__ == '__main__': | ||
number = tf.constant([1.0, 1.0]) | ||
func(number) |
1 change: 1 addition & 0 deletions
1
....hybridize.tests/resources/HybridizeFunction/testDecoratorArguments24/in/requirements.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
tensorflow==2.9.3 |
11 changes: 11 additions & 0 deletions
11
edu.cuny.hunter.hybridize.tests/resources/HybridizeFunction/testDecoratorArguments25/in/A.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import custom | ||
|
||
|
||
@custom.decorator(input_signature=None) | ||
def func(x): | ||
print('Tracing with', x) | ||
return x | ||
|
||
|
||
if __name__ == '__main__': | ||
func(1) |
11 changes: 11 additions & 0 deletions
11
....hunter.hybridize.tests/resources/HybridizeFunction/testDecoratorArguments25/in/custom.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
def decorator(input_signature=None): | ||
|
||
def decorated(inner_function): | ||
|
||
def wrapper(*args, **kwargs): | ||
result = function(*args, **kwargs) | ||
return result | ||
|
||
return decorated | ||
|
||
return decorator |
1 change: 1 addition & 0 deletions
1
....hybridize.tests/resources/HybridizeFunction/testDecoratorArguments25/in/requirements.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
12 changes: 12 additions & 0 deletions
12
edu.cuny.hunter.hybridize.tests/resources/HybridizeFunction/testDecoratorArguments26/in/A.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import custom | ||
import tensorflow as tf | ||
|
||
|
||
@custom.decorator(input_signature=None) | ||
@tf.function(autograph=False) | ||
def func(): | ||
pass | ||
|
||
|
||
if __name__ == '__main__': | ||
func() |
11 changes: 11 additions & 0 deletions
11
....hunter.hybridize.tests/resources/HybridizeFunction/testDecoratorArguments26/in/custom.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
def decorator(input_signature=None): | ||
|
||
def decorated(inner_function): | ||
|
||
def wrapper(*args, **kwargs): | ||
result = function(*args, **kwargs) | ||
return result | ||
|
||
return decorated | ||
|
||
return decorator |
1 change: 1 addition & 0 deletions
1
....hybridize.tests/resources/HybridizeFunction/testDecoratorArguments26/in/requirements.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
tensorflow==2.9.3 |
11 changes: 11 additions & 0 deletions
11
edu.cuny.hunter.hybridize.tests/resources/HybridizeFunction/testDecoratorArguments27/in/A.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import tensorflow as tf | ||
|
||
|
||
@tf.function(autograph=False) | ||
@tf.function(jit_compile=True) | ||
def func(x): | ||
return x | ||
|
||
|
||
if __name__ == '__main__': | ||
func(tf.constant(1)) |
1 change: 1 addition & 0 deletions
1
....hybridize.tests/resources/HybridizeFunction/testDecoratorArguments27/in/requirements.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
tensorflow==2.9.3 |
13 changes: 13 additions & 0 deletions
13
edu.cuny.hunter.hybridize.tests/resources/HybridizeFunction/testDecoratorArguments28/in/A.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import tensorflow as tf | ||
|
||
var = (tf.TensorSpec(shape=[None], dtype=tf.float32),) | ||
|
||
|
||
@tf.function(input_signature=var) | ||
def func(x): | ||
return x | ||
|
||
|
||
if __name__ == '__main__': | ||
number = tf.constant([1.0, 1.0]) | ||
func(number) |
1 change: 1 addition & 0 deletions
1
....hybridize.tests/resources/HybridizeFunction/testDecoratorArguments28/in/requirements.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
tensorflow==2.9.3 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are
hashCode
andequals
being overridden for this class? Are you comparing these or putting them into aSet
(this is a question)?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is overridden because, in our tests, I check am checking that the list of tensorspec that is generated is the same one as the one provided.
https://github.com/tatianacv/Hybridize-Functions-Refactoring/blob/9163368a396e3108700da9aa211a27f0f1d47160/edu.cuny.hunter.hybridize.tests/test%20cases/edu/cuny/hunter/hybridize/tests/HybridizeFunctionRefactoringTest.java#L920-L929