Skip to content

Commit

Permalink
Fix imag function for Numpy frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
Joboa committed Feb 10, 2023
1 parent 203d00c commit 764aa2b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 20 deletions.
Original file line number Diff line number Diff line change
@@ -1,19 +1,10 @@
# global
import ivy
from ivy.functional.frontends.numpy import promote_types_of_numpy_inputs
from ivy.functional.frontends.numpy.func_wrapper import (
to_ivy_arrays_and_back,
handle_numpy_casting,
handle_numpy_dtype,
from_zero_dim_arrays_to_scalar,
handle_numpy_out,
)


# @handle_numpy_dtype
# @to_ivy_arrays_and_back
# @from_zero_dim_arrays_to_scalar
@to_ivy_arrays_and_back
def _imag(val):
# if dtype:
# val = [ivy.astype(ivy.array(v), ivy.as_ivy_dtype(dtype)) for v in val]
return ivy.imag(val)
return ivy.imag(val)
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
# global
from hypothesis import assume, given, strategies as st
import numpy as np
from hypothesis import strategies as st

# local
import ivy_tests.test_ivy.helpers as helpers
import ivy_tests.test_ivy.test_frontends.test_numpy.helpers as np_frontend_helpers
from ivy_tests.test_ivy.helpers import handle_frontend_test


# imag
@handle_frontend_test(
fn_tree="numpy.imag",
dtype_and_x=helpers.dtype_and_values(
available_dtypes=helpers.get_dtypes("numeric")
),
dtype_and_x=helpers.dtype_and_values(available_dtypes=helpers.get_dtypes("valid")),
test_with_out=st.just(False),
)
def test_numpy_imag(
Expand All @@ -30,6 +26,5 @@ def test_numpy_imag(
test_flags=test_flags,
fn_tree=fn_tree,
on_device=on_device,
test_values=False,
val=x,
)
val=x[0],
)

0 comments on commit 764aa2b

Please sign in to comment.