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
Loading
Please sign in to comment