Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ivy failing test paddle backend creation.arange #28462

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions ivy/functional/backends/paddle/creation.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from ivy.func_wrapper import (
with_unsupported_device_and_dtypes,
with_supported_device_and_dtypes,
with_supported_dtypes,
)
from ivy.functional.ivy.creation import (
_asarray_to_native_arrays_and_back,
Expand All @@ -30,6 +31,17 @@
# -------------------#


@with_supported_dtypes(
{
"2.6.0 and below": (
"int32",
"int64",
"float64",
"float32",
)
},
backend_version,
)
def arange(
start: float,
/,
Expand Down
2 changes: 2 additions & 0 deletions ivy/functional/backends/paddle/data_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ def astype(
) -> paddle.Tensor:
dtype = ivy.as_native_dtype(dtype)
if x.dtype == dtype:
if paddle.is_empty(x):
return paddle.empty_like(x) if copy else x
return x.clone() if copy else x
return x.clone().cast(dtype) if copy else x.cast(dtype)

Expand Down
1 change: 1 addition & 0 deletions ivy/functional/backends/tensorflow/creation.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"float16",
"bfloat16",
"complex",
"bool",
)
},
backend_version,
Expand Down
10 changes: 9 additions & 1 deletion ivy/functional/backends/torch/creation.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,15 @@ def _differentiable_linspace(start, stop, num, *, device, dtype=None):
return res


@with_unsupported_dtypes({"2.2 and below": ("complex",)}, backend_version)
@with_unsupported_dtypes(
{
"2.2 and below": (
"complex",
"bool",
)
},
backend_version,
)
def arange(
start: float,
/,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def is_capsule(o):
step=helpers.ints(min_value=-50, max_value=50).filter(
lambda x: True if x != 0 else False
),
dtype=helpers.get_dtypes("numeric", full=False),
dtype=helpers.get_dtypes("valid", full=False),
test_instance_method=st.just(False),
test_gradients=st.just(False),
)
Expand Down
Loading