Skip to content

Commit

Permalink
logical_not (#14095)
Browse files Browse the repository at this point in the history
Added logical_not to TF frontend. 

Co-authored by: Yusha Arif <[email protected]>
  • Loading branch information
Emanuele-n authored Apr 24, 2023
1 parent aa26d97 commit 74d1a05
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ivy/functional/frontends/tensorflow/math.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,11 @@ def log_sigmoid(x, name=None):
return -ivy.softplus(-x)


@to_ivy_arrays_and_back
def logical_not(x, name="logical_not"):
return ivy.logical_not(x)


@to_ivy_arrays_and_back
def log1p(x, name=None):
return ivy.log1p(x)
Expand Down
29 changes: 29 additions & 0 deletions ivy_tests/test_ivy/test_frontends/test_tensorflow/test_math.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,35 @@ def test_tensorflow_squared_difference(
)


# logical_not
@handle_frontend_test(
fn_tree="tensorflow.math.logical_not",
dtype_and_x=helpers.dtype_and_values(
available_dtypes=tuple([ivy.bool]),
num_arrays=2,
shared_dtype=True,
),
test_with_out=st.just(False),
)
def test_tensorflow_logical_not(
*,
dtype_and_x,
frontend,
test_flags,
fn_tree,
on_device,
):
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,
x=x[0],
)


# logical_xor
@handle_frontend_test(
fn_tree="tensorflow.math.logical_xor",
Expand Down

0 comments on commit 74d1a05

Please sign in to comment.