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: fixed unsupported complex dtype at jax and torch backend #27948

Merged
merged 3 commits into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions ivy/functional/backends/jax/elementwise.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def abs(
return jnp.where(x != 0, jnp.absolute(x), 0)


@with_unsupported_dtypes({"0.4.23 and below": ("complex",)}, backend_version)
def acos(x: JaxArray, /, *, out: Optional[JaxArray] = None) -> JaxArray:
return jnp.arccos(x)

Expand Down
2 changes: 1 addition & 1 deletion ivy/functional/backends/torch/elementwise.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ def greater_equal(
greater_equal.support_native_out = True


@with_unsupported_dtypes({"2.1.2 and below": ("float16",)}, backend_version)
@with_unsupported_dtypes({"2.1.2 and below": ("complex",)}, backend_version)
@handle_numpy_arrays_in_specific_backend
def acos(x: torch.Tensor, /, *, out: Optional[torch.Tensor] = None) -> torch.Tensor:
x = _cast_for_unary_op(x)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def test_abs(*, dtype_and_x, test_flags, backend_fw, fn_name, on_device):
@handle_test(
fn_tree="functional.ivy.acos",
dtype_and_x=helpers.dtype_and_values(
available_dtypes=helpers.get_dtypes("valid"),
available_dtypes=helpers.get_dtypes("float_and_complex"),
large_abs_safety_factor=4,
small_abs_safety_factor=4,
safety_factor_scale="log",
Expand Down
Loading