Repository: ivy-llc/ivy

Issue:
interpolate
- [interpolate] #21024 


Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/mindspore/ops/function/nn_func.py b/ivy/functional/frontends/mindspore/ops/function/nn_func.py
--- a/ivy/functional/frontends/mindspore/ops/function/nn_func.py
+++ b/ivy/functional/frontends/mindspore/ops/function/nn_func.py
@@ -38,6 +38,39 @@ def softsign(x):
     return ivy.divide(x, ivy.add(1, ivy.abs(x)))
 
 
+@with_supported_dtypes(
+    {
+        "2.0.0 and below": (
+            "int8",
+            "int16",
+            "int32",
+            "int64",
+            "float16",
+            "float32",
+            "float64",
+        )
+    },
+    "mindspore",
+)
+@to_ivy_arrays_and_back
+def interpolate(
+    input,
+    size=None,
+    scale_factor=None,
+    mode="nearest",
+    align_corners=False,
+    recompute_scale_factor=False,
+):
+    return ivy.interpolate(
+        input,
+        size=size,
+        scale_factor=scale_factor,
+        mode=mode,
+        align_corners=align_corners,
+        recompute_scale_factor=recompute_scale_factor,
+    )
+
+
 @with_supported_dtypes(
     {
         "2.0 and below": (


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_mindspore/test_ops/test_function/test_mindspore_nn_func.py b/ivy_tests/test_ivy/test_frontends/test_mindspore/test_ops/test_function/test_mindspore_nn_func.py
--- a/ivy_tests/test_ivy/test_frontends/test_mindspore/test_ops/test_function/test_mindspore_nn_func.py
+++ b/ivy_tests/test_ivy/test_frontends/test_mindspore/test_ops/test_function/test_mindspore_nn_func.py
@@ -79,6 +79,82 @@
 #     )
 
 
+# def _size_strategy():
+#     return st.one_of(
+#         st.integers(min_value=1, max_value=10),
+#         st.tuples(st.integers(min_value=1, max_value=10)),
+#         st.lists(st.integers(min_value=1, max_value=10), min_size=3, max_size=3),
+#     )
+
+# def _scale_factor_strategy():
+#     return st.one_of(
+#         st.floats(min_value=0.1, max_value=2.0),
+#         st.tuples(st.floats(min_value=0.1, max_value=2.0)),
+#         st.lists(st.floats(min_value=0.1, max_value=2.0), min_size=3, max_size=3),
+#     )
+
+# def _size_and_scale_factor_strategy():
+#     return st.one_of(
+#         st.tuples(size_strategy(), st.just(None)),
+#         st.tuples(st.just(None), scale_factor_strategy()),
+#         st.tuples(size_strategy(), scale_factor_strategy()),
+#     )
+
+
+# @handle_frontend_test(
+#     fn_tree="mindspore.ops.function.nn_func.interpolate",
+#     dtype_and_x=helpers.dtype_and_values(
+#         available_dtypes=helpers.get_dtypes("valid"),
+#         num_arrays=1,
+#         shared_dtype=True,
+#     ),
+#     mode=st.sampled_from(
+#         [
+#             "nearest",
+#             "linear",
+#             "bilinear",
+#             "bicubic",
+#             "trilinear",
+#             "area",
+#             "nearest-exact",
+#         ]
+#     ),
+#     align_corners=st.booleans(),
+#     recompute_scale_factor=st.booleans(),
+#     size_and_scale_factor = _size_and_scale_factor_strategy()
+# )
+# def test_mindspore_interpolate(
+#     *,
+#     dtype_and_x,
+#     size,
+#     scale_factor,
+#     mode,
+#     align_corners,
+#     recompute_scale_factor,
+#     on_device,
+#     fn_tree,
+#     frontend,
+#     test_flags,
+# ):
+#     dtype, x = dtype_and_x
+#     size,scale_factor = size_and_scale_factor
+
+
+#     helpers.test_frontend_function(
+#         input_dtypes=dtype,
+#         frontend=frontend,
+#         test_flags=test_flags,
+#         fn_tree=fn_tree,
+#         on_device=on_device,
+#         input=x[0],
+#         size=size,
+#         scale_factor=scale_factor,
+#         mode=mode,
+#         align_corners=align_corners,
+#         recompute_scale_factor=recompute_scale_factor,
+#     )
+
+
 # pad
 # @handle_frontend_test(
 #     fn_tree="pad",