Skip to content

Commit

Permalink
🤖 Lint code
Browse files Browse the repository at this point in the history
  • Loading branch information
ivy-branch committed Feb 29, 2024
1 parent 24c5f75 commit d05d032
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions ivy/functional/frontends/paddle/manipulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,6 @@ def gather_nd(x, index, name=None):
return ivy.gather_nd(x, index)


@with_supported_dtypes({"2.5.1 and below": ("int32", "int64")}, "paddle")
@to_ivy_arrays_and_back
def one_hot(x, num_classes, name=None):
if not isinstance(num_classes, int) or num_classes <= 0:
raise ValueError("num_classes must be a positive integer.")

one_hot_tensor = ivy.one_hot(x, num_classes)
return one_hot_tensor.astype(ivy.float32)



@with_supported_dtypes(
{"2.6.0 and below": ("bool", "int32", "int64", "float16", "float32", "float64")},
"paddle",
Expand Down Expand Up @@ -128,6 +117,16 @@ def index_add(x, index, axis, value, *, name=None):
return ret


@with_supported_dtypes({"2.5.1 and below": ("int32", "int64")}, "paddle")
@to_ivy_arrays_and_back
def one_hot(x, num_classes, name=None):
if not isinstance(num_classes, int) or num_classes <= 0:
raise ValueError("num_classes must be a positive integer.")

one_hot_tensor = ivy.one_hot(x, num_classes)
return one_hot_tensor.astype(ivy.float32)


@to_ivy_arrays_and_back
def put_along_axis(arr, indices, values, axis, reduce="assign"):
result = ivy.put_along_axis(arr, indices, values, axis)
Expand Down

0 comments on commit d05d032

Please sign in to comment.