Skip to content

Commit 5568ea8

Browse files
Updated the README files concerning testing. (#1344)
1 parent 2125961 commit 5568ea8

File tree

10 files changed

+40
-39
lines changed

10 files changed

+40
-39
lines changed

tensorflow_addons/activations/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ must:
1313

1414
#### Testing Requirements
1515
* Simple unittests that demonstrate the layer is behaving as expected.
16-
* When applicable, run all unittests with TensorFlow's
17-
`@run_in_graph_and_eager_modes` (for test method)
18-
or `run_all_in_graph_and_eager_modes` (for TestCase subclass)
19-
decorator.
16+
* To run your `tf.functions` in eager mode and graph mode in the tests,
17+
you can use the `@pytest.mark.usefixtures("maybe_run_functions_eagerly")`
18+
decorator. This will run the tests twice, once normally, and once
19+
with `tf.config.experimental_run_functions_eagerly(True)`.
2020
* Add a `py_test` to this sub-package's BUILD file.
2121
* Add activation name to [activations_test.py](https://github.com/tensorflow/addons/tree/master/tensorflow_addons/activations/activations_test.py) to test serialization.
2222

tensorflow_addons/callbacks/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ must:
1313

1414
#### Testing Requirements
1515
* Simple unittests that demonstrate the callback is behaving as expected.
16-
* When applicable, run all unittests with TensorFlow's
17-
`@run_in_graph_and_eager_modes` (for test method)
18-
or `run_all_in_graph_and_eager_modes` (for TestCase subclass)
19-
decorator.
16+
* To run your `tf.functions` in eager mode and graph mode in the tests,
17+
you can use the `@pytest.mark.usefixtures("maybe_run_functions_eagerly")`
18+
decorator. This will run the tests twice, once normally, and once
19+
with `tf.config.experimental_run_functions_eagerly(True)`.
2020
* Add a `py_test` to this sub-package's BUILD file.
2121

2222
#### Documentation Requirements

tensorflow_addons/image/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ must:
1616
#### Testing Requirements
1717
* Simple unittests that demonstrate the image op is behaving as
1818
expected.
19-
* When applicable, run all unittests with TensorFlow's
20-
`@run_in_graph_and_eager_modes` (for test method)
21-
or `run_all_in_graph_and_eager_modes` (for TestCase subclass)
22-
decorator.
19+
* To run your `tf.functions` in eager mode and graph mode in the tests,
20+
you can use the `@pytest.mark.usefixtures("maybe_run_functions_eagerly")`
21+
decorator. This will run the tests twice, once normally, and once
22+
with `tf.config.experimental_run_functions_eagerly(True)`.
2323
* Add a `py_test` to this sub-package's BUILD file.
2424

2525
#### Documentation Requirements

tensorflow_addons/layers/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ must:
1313

1414
#### Testing Requirements
1515
* Simple unittests that demonstrate the layer is behaving as expected.
16-
* When applicable, run all unittests with TensorFlow's
17-
`@run_in_graph_and_eager_modes` (for test method)
18-
or `run_all_in_graph_and_eager_modes` (for TestCase subclass)
19-
decorator.
16+
* To run your `tf.functions` in eager mode and graph mode in the tests,
17+
you can use the `@pytest.mark.usefixtures("maybe_run_functions_eagerly")`
18+
decorator. This will run the tests twice, once normally, and once
19+
with `tf.config.experimental_run_functions_eagerly(True)`.
2020
* Run `layer_test` on the layer.
2121
* Add a `py_test` to this sub-package's BUILD file.
2222

tensorflow_addons/losses/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ must:
1414
#### Testing Requirements
1515
* Simple unittests that demonstrate the loss is behaving as expected on
1616
some set of known inputs and outputs.
17-
* When applicable, run all tests with TensorFlow's
18-
`@run_in_graph_and_eager_modes` (for test method)
19-
or `run_all_in_graph_and_eager_modes` (for TestCase subclass)
20-
decorator.
17+
* To run your `tf.functions` in eager mode and graph mode in the tests,
18+
you can use the `@pytest.mark.usefixtures("maybe_run_functions_eagerly")`
19+
decorator. This will run the tests twice, once normally, and once
20+
with `tf.config.experimental_run_functions_eagerly(True)`.
2121
* Add a `py_test` to this sub-package's BUILD file.
2222

2323
#### Documentation Requirements

tensorflow_addons/metrics/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ must:
1313

1414
#### Testing Requirements
1515
* Simple unittests that demonstrate the metric is behaving as expected.
16-
* When applicable, run all unittests with TensorFlow's
17-
`@run_in_graph_and_eager_modes` (for test method)
18-
or `run_all_in_graph_and_eager_modes` (for TestCase subclass)
19-
decorator.
16+
* To run your `tf.functions` in eager mode and graph mode in the tests,
17+
you can use the `@pytest.mark.usefixtures("maybe_run_functions_eagerly")`
18+
decorator. This will run the tests twice, once normally, and once
19+
with `tf.config.experimental_run_functions_eagerly(True)`.
2020
* Add a `py_test` to this sub-package's BUILD file.
2121

2222
#### Documentation Requirements

tensorflow_addons/optimizers/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ must:
1212
* Add the addon to the `py_library` in this sub-package's BUILD file.
1313

1414
#### Testing Requirements
15-
* When applicable, run all tests with TensorFlow's
16-
`@run_in_graph_and_eager_modes` (for test method)
17-
or `run_all_in_graph_and_eager_modes` (for TestCase subclass)
18-
decorator.
15+
* To run your `tf.functions` in eager mode and graph mode in the tests,
16+
you can use the `@pytest.mark.usefixtures("maybe_run_functions_eagerly")`
17+
decorator. This will run the tests twice, once normally, and once
18+
with `tf.config.experimental_run_functions_eagerly(True)`.
1919
* Add a `py_test` to this sub-package's BUILD file.
2020

2121
#### Documentation Requirements

tensorflow_addons/rnn/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ In order to conform with the current API standard, all cells must:
1818
* Add the addon to the `py_library` in this sub-package's BUILD file.
1919

2020
#### Testing Requirements
21-
* When applicable, run all tests with TensorFlow's
22-
`@run_in_graph_and_eager_modes` (for test method)
23-
or `@run_all_in_graph_and_eager_modes` (for TestCase subclass)
24-
decorator.
21+
* To run your `tf.functions` in eager mode and graph mode in the tests,
22+
you can use the `@pytest.mark.usefixtures("maybe_run_functions_eagerly")`
23+
decorator. This will run the tests twice, once normally, and once
24+
with `tf.config.experimental_run_functions_eagerly(True)`.
2525
* Add a `py_test` to this sub-package's BUILD file.
2626

2727
#### Documentation Requirements

tensorflow_addons/seq2seq/README.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ In order to conform with the current API standard, all objects must:
1414
#### Testing Requirements
1515
* Simple unittests that demonstrate the class is behaving as expected on
1616
some set of known inputs and outputs.
17-
* When applicable, run all tests with TensorFlow's
18-
`@run_in_graph_and_eager_modes` (for test method)
19-
or `run_all_in_graph_and_eager_modes` (for TestCase subclass) decorator.
17+
* To run your `tf.functions` in eager mode and graph mode in the tests,
18+
you can use the `@pytest.mark.usefixtures("maybe_run_functions_eagerly")`
19+
decorator. This will run the tests twice, once normally, and once
20+
with `tf.config.experimental_run_functions_eagerly(True)`.
2021
* Add a `py_test` to this sub-package's BUILD file.
2122

2223
## Sample code and Migration guide from TF 1.X

tensorflow_addons/text/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ must:
1515
#### Testing Requirements
1616
* Simple unittests that demonstrate the text op is behaving as
1717
expected.
18-
* When applicable, run all unittests with TensorFlow's
19-
`@run_in_graph_and_eager_modes` (for test method)
20-
or `run_all_in_graph_and_eager_modes` (for TestCase subclass)
21-
decorator.
18+
* To run your `tf.functions` in eager mode and graph mode in the tests,
19+
you can use the `@pytest.mark.usefixtures("maybe_run_functions_eagerly")`
20+
decorator. This will run the tests twice, once normally, and once
21+
with `tf.config.experimental_run_functions_eagerly(True)`.
2222
* Add a `py_test` to this sub-package's BUILD file.
2323

2424
#### Documentation Requirements

0 commit comments

Comments
 (0)