Commit 45db3aee authored by Asim Shankar's avatar Asim Shankar Committed by TensorFlower Gardener
Browse files

relu_op_test: Make all tests work in both TF 1 and 2

i.e., update all tests so that they don't need the
@test_util.run_deprecated_v1 decorator
(essentially enabled by gradient_checker_v2).

Noteworthy: This increases time to execute the test slightly in TF 1.x
(as gradient_checker_v2.compute_gradients adds nodes to the graph twice
- once for the analytical and once for the numeric gradients),
but tests with TF2_BEHAVIOR=1 are generally much faster. For example, on my
machine:

1.8s (without this change - bazel test :relu_ops_test)
2.1s (with this change - bazel test :relu_op_test)
0.6s (with this change -bazel test --test_env=TF2_BEHAVIOR=1 :relu_op_test)

PiperOrigin-RevId: 224046219
parent 09354505
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment