Skip to content

Commit

Permalink
Minor changes to the helpers to enable gradient testing (#6137)
Browse files Browse the repository at this point in the history
  • Loading branch information
vedpatwardhan authored Oct 25, 2022
1 parent 3c2d2aa commit 643d888
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions ivy_tests/test_ivy/helpers/function_testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,12 +357,7 @@ def test_function(
raise e
ivy.unset_backend()
# gradient test
if (
test_gradients
and not fw == "numpy"
and all(as_variable_flags)
and not instance_method
):
if test_gradients and not fw == "numpy" and not instance_method:
gradient_test(
fn_name=fn_name,
all_as_kwargs_np=all_as_kwargs_np,
Expand Down Expand Up @@ -851,9 +846,6 @@ def grad_fn(xs):
len(grads_np_from_gt_flat),
)

if len(grads_np_flat) < 2:
return

for grad_np_flat, grad_np_from_gt_flat in zip(grads_np_flat, grads_np_from_gt_flat):
value_test(
ret_np_flat=grad_np_flat,
Expand Down

0 comments on commit 643d888

Please sign in to comment.