diff --git a/ivy/functional/frontends/paddle/tensor/tensor.py b/ivy/functional/frontends/paddle/tensor/tensor.py index c1c03b7a71207..d8a76e34a40c1 100644 --- a/ivy/functional/frontends/paddle/tensor/tensor.py +++ b/ivy/functional/frontends/paddle/tensor/tensor.py @@ -367,6 +367,40 @@ def logical_or(self, y, out=None, name=None): def bitwise_xor(self, y, out=None, name=None): return paddle_frontend.bitwise_xor(self, y) + @with_supported_dtypes( + { + "2.5.1 and below": ( + "bool", + "int8", + "int16", + "int32", + "int64", + "float32", + "float64", + ) + }, + "paddle", + ) + def logical_xor(self, y, out=None, name=None): + return paddle_frontend.logical_xor(self, y, out=out) + + @with_supported_dtypes( + { + "2.5.1 and below": ( + "float16", + "float32", + "float64", + "int8", + "int16", + "int32", + "int64", + ) + }, + "paddle", + ) + def broadcast_tensors(self, name=None): + return paddle_frontend.Tensor(ivy.broadcast_arrays(self._ivy_array)) + @with_supported_dtypes({"2.5.1 and below": ("float16", "bfloat16")}, "paddle") def any(self, axis=None, keepdim=False, name=None): return paddle_frontend.any(self, axis=axis, keepdim=keepdim) diff --git a/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_tensor.py b/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_tensor.py index 2f6c9970003a0..740f495dbe982 100644 --- a/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_tensor.py +++ b/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_tensor.py @@ -1128,6 +1128,46 @@ def test_paddle_tensor_bitwise_xor( ) +# broadcast_tensors +@handle_frontend_method( + class_tree=CLASS_TREE, + init_tree="paddle.to_tensor", + method_name="broadcast_tensors", + dtype_x_axis=helpers.dtype_values_axis( + available_dtypes=helpers.get_dtypes("float"), + # valid_axis=True, + # force_int_axis=True, + # min_num_dims=1, + # min_value=-5, + # max_value=5, + ), +) +def test_paddle_tensor_broadcast_tensors( + dtype_x_axis, + frontend_method_data, + init_flags, + method_flags, + frontend, + on_device, + backend_fw, +): + input_dtype, x, axis = dtype_x_axis + helpers.test_frontend_method( + init_input_dtypes=input_dtype, + backend_to_test=backend_fw, + init_all_as_kwargs_np={ + "data": [x], + }, + method_input_dtypes=input_dtype, + method_all_as_kwargs_np={}, + frontend_method_data=frontend_method_data, + init_flags=init_flags, + method_flags=method_flags, + frontend=frontend, + on_device=on_device, + ) + + # cast @handle_frontend_method( class_tree=CLASS_TREE,