Skip to content

Commit

Permalink
Tensorflow math sigmoid function and test. close ivy-llc#9725
Browse files Browse the repository at this point in the history
  • Loading branch information
Ishticode committed Jan 16, 2023
1 parent 4efe2bd commit 3e7a32c
Show file tree
Hide file tree
Showing 2 changed files with 40 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 @@ -395,3 +395,8 @@ def ceil(x, name=None):
@to_ivy_arrays_and_back
def minimum(x, y, name=None):
return ivy.minimum(x, y)


@to_ivy_arrays_and_back
def sigmoid(x, name=None):
return ivy.sigmoid(x)
35 changes: 35 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 @@ -1497,3 +1497,38 @@ def test_tensorflow_minimum(
x=x[0],
y=x[1],
)


# sigmoid
@handle_frontend_test(
fn_tree="tensorflow.math.sigmoid",
dtype_and_x=helpers.dtype_and_values(
available_dtypes=helpers.get_dtypes("float_and_complex"),
num_arrays=1,
min_value=-20,
max_value=20,)
)
def test_tensorflow_sigmoid(
*,
dtype_and_x,
as_variable,
num_positional_args,
native_array,
on_device,
fn_tree,
frontend,
):
input_dtype, x = dtype_and_x
helpers.test_frontend_function(
input_dtypes=input_dtype,
as_variable_flags=as_variable,
with_out=False,
num_positional_args=num_positional_args,
native_array_flags=native_array,
frontend=frontend,
fn_tree=fn_tree,
on_device=on_device,
rtol=1e-2,
atol=1e-2,
x=x[0],
)

0 comments on commit 3e7a32c

Please sign in to comment.