Skip to content

Commit

Permalink
increment
Browse files Browse the repository at this point in the history
  • Loading branch information
muhammadhammad-tech authored Sep 29, 2023
1 parent dfe5ea0 commit 065255b
Show file tree
Hide file tree
Showing 6 changed files with 230 additions and 130 deletions.
23 changes: 18 additions & 5 deletions ivy/functional/frontends/paddle/math.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,18 @@ def heaviside(x, y, name=None):
return ivy.heaviside(x, y)


@with_supported_dtypes(
{"2.5.1 and below": ("int32", "int64", "float32", "float64")}, "paddle"
)
@to_ivy_arrays_and_back
def increment(x, value=1.0, name=None):
if (
ivy.prod(ivy.shape(x)) != 1
): # TODO this function will be simplified as soon as ivy.increment is add
raise ValueError("The input tensor x must contain only one element.")
return ivy.add(x, value)


@with_supported_dtypes({"2.5.1 and below": ("float32", "float64")}, "paddle")
@to_ivy_arrays_and_back
def inner(x, y, name=None):
Expand Down Expand Up @@ -338,6 +350,12 @@ def log(x, name=None):
return ivy.log(x)


@with_supported_dtypes({"2.5.1 and below": ("float32", "float64")}, "paddle")
@to_ivy_arrays_and_back
def log10(x, name=None):
return ivy.log10(x)


@with_supported_dtypes({"2.5.1 and below": ("float32", "float64")}, "paddle")
@to_ivy_arrays_and_back
def log1p(x, name=None):
Expand All @@ -349,11 +367,6 @@ def log1p(x, name=None):
def log2(x, name=None):
return ivy.log2(x)

@with_supported_dtypes({"2.5.1 and below": ("float32", "float64")}, "paddle")
@to_ivy_arrays_and_back
def log10(x, name=None):
return ivy.log10(x)


@with_unsupported_dtypes({"2.5.1 and below": ("float16", "bfloat16")}, "paddle")
@to_ivy_arrays_and_back
Expand Down
6 changes: 6 additions & 0 deletions ivy/functional/frontends/paddle/tensor/tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -798,3 +798,9 @@ def real(self, name=None):
)
def cast(self, dtype):
return paddle_frontend.cast(self, dtype)

@with_supported_dtypes(
{"2.5.1 and below": ("int32", "int64", "float32", "float64")}, "paddle"
)
def increment(self, value, name=None):
return paddle_frontend.increment(self, value)
2 changes: 1 addition & 1 deletion ivy/functional/frontends/torch/comparison_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ def topk(input, k, dim=None, largest=True, sorted=True, *, out=None):


gt = greater
ne = not_equal
ge = greater_equal
le = less_equal
lt = less
ne = not_equal
Loading

0 comments on commit 065255b

Please sign in to comment.