Skip to content

Commit

Permalink
isfortran (ivy-llc#10565)
Browse files Browse the repository at this point in the history
Co-authored-by: Vansh Gupta <[email protected]>
  • Loading branch information
shireenchand and V-G-spec authored Feb 18, 2023
1 parent e180c4f commit 313a167
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ivy/functional/frontends/numpy/logic/truth_value_testing.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# global
import ivy
import numpy as np
from ivy.functional.frontends.numpy.func_wrapper import (
to_ivy_arrays_and_back,
from_zero_dim_arrays_to_scalar,
Expand Down Expand Up @@ -50,3 +51,8 @@ def isscalar(element):
or isinstance(element, bool)
or isinstance(element, float)
)


@to_ivy_arrays_and_back
def isfortran(a: np.ndarray):
return a.flags.fnc
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,29 @@ def test_numpy_isscalar(
on_device=on_device,
element=element,
)


@handle_frontend_test(
fn_tree="numpy.isfortran",
dtype_and_x=helpers.dtype_and_values(
available_dtypes=helpers.get_dtypes("float"), min_num_dims=1
),
test_with_out=st.just(False),
)
def test_numpy_isfortran(
dtype_and_x,
frontend,
on_device,
*,
fn_tree,
test_flags,
):
input_dtype, x = dtype_and_x
helpers.test_frontend_function(
input_dtypes=input_dtype,
frontend=frontend,
test_flags=test_flags,
fn_tree=fn_tree,
on_device=on_device,
a=x[0],
)

0 comments on commit 313a167

Please sign in to comment.