diff --git a/ivy/functional/frontends/paddle/tensor/tensor.py b/ivy/functional/frontends/paddle/tensor/tensor.py index f6c6391aa68ca..35e76cebe8f7b 100644 --- a/ivy/functional/frontends/paddle/tensor/tensor.py +++ b/ivy/functional/frontends/paddle/tensor/tensor.py @@ -328,3 +328,7 @@ def fmin(self, y, name=None): def minimum(self, y, name=None): y_ivy = _to_ivy_array(y) return ivy.minimum(self._ivy_array, y_ivy) + + @with_unsupported_dtypes({"2.4.2 and below": ("float32", "float64")}, "paddle") + def std(self, axis=None, unbiased=True, keepdim=False, name=None): + return ivy.std(self._ivy_array, axis=axis, keepdims=keepdim) diff --git a/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_paddle_tensor.py b/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_paddle_tensor.py index f23ee4f6d5481..a17564cc7e242 100644 --- a/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_paddle_tensor.py +++ b/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_paddle_tensor.py @@ -1710,3 +1710,44 @@ def test_paddle_minimum( frontend=frontend, on_device=on_device, ) + + +# std +@handle_frontend_method( + class_tree=CLASS_TREE, + init_tree="paddle.to_tensor", + method_name="std", + dtypes_and_x=helpers.dtype_and_values( + available_dtypes=st.one_of(helpers.get_dtypes("float")), + min_axis=-1, + max_axis=0, + ), + keep_dims=st.booleans(), + unbiased=st.booleans(), +) +def test_paddle_std( + dtype_x_axis, + keep_dims, + frontend_method_data, + init_flags, + method_flags, + frontend, + on_device, +): + input_dtypes, x, axis = dtype_x_axis + helpers.test_frontend_method( + init_input_dtypes=input_dtypes, + init_all_as_kwargs_np={ + "object": x[0], + }, + method_input_dtypes=input_dtypes, + method_all_as_kwargs_np={ + "axis": axis, + "keepdim": keep_dims, + }, + frontend_method_data=frontend_method_data, + init_flags=init_flags, + method_flags=method_flags, + frontend=frontend, + on_device=on_device, + )