diff --git a/ivy/functional/frontends/tensorflow/raw_ops.py b/ivy/functional/frontends/tensorflow/raw_ops.py index 1d4c66522f301..b609e26ea55c3 100644 --- a/ivy/functional/frontends/tensorflow/raw_ops.py +++ b/ivy/functional/frontends/tensorflow/raw_ops.py @@ -607,3 +607,9 @@ def Elu(features, name=None): "float64", ), } + + +# @with_unsupported_dtypes({"2.9.1 and below": ()}, "tensorflow") +@to_ivy_arrays_and_back +def LinSpace(*, start, stop, num, name=None): + return ivy.linspace(start, stop, num) diff --git a/ivy_tests/test_ivy/test_frontends/test_tensorflow/test_raw_ops.py b/ivy_tests/test_ivy/test_frontends/test_tensorflow/test_raw_ops.py index 4d8429c10435c..d9f33e9b2bf17 100644 --- a/ivy_tests/test_ivy/test_frontends/test_tensorflow/test_raw_ops.py +++ b/ivy_tests/test_ivy/test_frontends/test_tensorflow/test_raw_ops.py @@ -3057,3 +3057,58 @@ def test_tensorflow_Elu( features=x[0], name=name, ) + + +@st.composite +def _LinSpace_helper(draw): + shape = () + dtype = draw(st.sampled_from(["float32", "float64"])) + + # Param: start + start = draw( + helpers.array_values( + dtype=dtype, + shape=shape, + min_value=-5.0, + max_value=5.0, + ), + ) + + # Param: stop + stop = draw( + helpers.array_values( + dtype=dtype, + shape=shape, + min_value=-4.0, + max_value=10.0, + ), + ) + + return [dtype] * 2, start, stop + + +@handle_frontend_test( + fn_tree="tensorflow.raw_ops.LinSpace", + dtype_and_params=_LinSpace_helper(), + num=helpers.ints(min_value=2, max_value=10), +) +def test_tensorflow_LinSpace( + *, + dtype_and_params, + num, + on_device, + fn_tree, + frontend, + test_flags, +): + dtype, start, stop = dtype_and_params + helpers.test_frontend_function( + input_dtypes=dtype, + frontend=frontend, + test_flags=test_flags, + fn_tree=fn_tree, + start=start, + stop=stop, + num=num, + on_device=on_device, + )