Skip to content

Commit

Permalink
feat (Paddle backend)(gradients.py): adding implementation for `ivy.r…
Browse files Browse the repository at this point in the history
…equires_gradient` for the Paddle backend
  • Loading branch information
YushaArif99 committed Sep 25, 2024
1 parent f163a1b commit 1f1e2cb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ivy/functional/backends/paddle/gradients.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,14 @@ def stop_gradient(
return variable(x)
return x

def requires_gradient(
x: paddle.Tensor,
) -> bool:
is_var = is_variable(x)
if is_var:
return x.stop_gradient
return False


def _get_jac_one_arg_fn(grad_fn, xs, out_idx):
nested_indices = iter(ivy.all_nested_indices(xs))
Expand Down

0 comments on commit 1f1e2cb

Please sign in to comment.