Skip to content

Commit

Permalink
Added log to tensorflow frontend. (unifyai#3811)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmshalan committed Aug 30, 2022
1 parent 2cccfd5 commit ada9f84
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ivy/functional/frontends/tensorflow/raw_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,7 @@ def Floor(*, x, name="Floor"):

def FloorDiv(*, x, y, name="FloorDiv"):
return ivy.floor_divide(x, y)


def Log(*, x, name="Log"):
return ivy.log(x)
29 changes: 29 additions & 0 deletions ivy_tests/test_ivy/test_frontends/test_tensorflow/test_raw_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -705,3 +705,32 @@ def test_tensorflow_FloorDiv(
x=np.asarray(x[0], dtype=input_dtype[0]),
y=np.asarray(x[1], dtype=input_dtype[1]),
)


# Log
@handle_cmd_line_args
@given(
dtype_and_x=helpers.dtype_and_values(
available_dtypes=tuple(
set(ivy_np.valid_float_dtypes).intersection(set(ivy_tf.valid_float_dtypes))
),
),
num_positional_args=helpers.num_positional_args(
fn_name="ivy.functional.frontends.tensorflow.Log"
),
)
def test_tensorflow_Log(
dtype_and_x, as_variable, num_positional_args, native_array, fw
):
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,
fw=fw,
frontend="tensorflow",
fn_tree="raw_ops.Log",
x=np.asarray(x, dtype=input_dtype),
)

0 comments on commit ada9f84

Please sign in to comment.