Skip to content

Commit

Permalink
🤖 Lint code
Browse files Browse the repository at this point in the history
  • Loading branch information
ivy-branch committed Mar 3, 2024
1 parent bfde3bd commit 6a40b27
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 43 deletions.
2 changes: 0 additions & 2 deletions ivy/functional/frontends/paddle/tensor/tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1244,7 +1244,6 @@ def expand(self, shape, name=None):
def tile(self, repeat_times):
return paddle_frontend.Tensor(ivy.tile(self._ivy_array, repeats=repeat_times))


@with_supported_dtypes({"2.5.1 and below": ("float32", "float64")}, "paddle")
def cholesky_solve(self, y, upper=False, name=None):
return paddle_frontend.cholesky_solve(self._ivy_array, y, upper=upper)
Expand All @@ -1266,4 +1265,3 @@ def cholesky_solve(self, y, upper=False, name=None):
)
def chunk(self, chunks, axis=0, name=None):
return paddle_frontend.split(self._ivy_array, num_or_sections=chunks, axis=axis)

Original file line number Diff line number Diff line change
Expand Up @@ -5755,6 +5755,47 @@ def test_paddle_tensor_add(
)


# _solve
@handle_frontend_method(
class_tree=CLASS_TREE,
init_tree="paddle.to_tensor",
method_name="cholesky_solve",
dtype_and_x=_get_second_matrix(),
dtype_and_y=_get_cholesky_matrix(),
)
def test_paddle_tensor_cholesky_solve(
dtype_and_x,
dtype_and_y,
frontend_method_data,
init_flags,
method_flags,
frontend,
on_device,
backend_fw,
):
input_dtype1, x = dtype_and_x
input_dtype2, y = dtype_and_y
helpers.test_frontend_method(
init_input_dtypes=[input_dtype1, input_dtype2],
backend_to_test=backend_fw,
init_all_as_kwargs_np={
"data": x,
},
method_input_dtypes=[input_dtype1, input_dtype2],
method_all_as_kwargs_np={
"y": y,
"upper": np.array_equal(y, np.triu(y)),
},
frontend_method_data=frontend_method_data,
init_flags=init_flags,
method_flags=method_flags,
frontend=frontend,
on_device=on_device,
rtol_=1e-3,
atol_=1e-3,
)


# chunk
@handle_frontend_method(
class_tree=CLASS_TREE,
Expand Down Expand Up @@ -6100,47 +6141,6 @@ def test_paddle_tensor_squeeze(
)


# _solve
@handle_frontend_method(
class_tree=CLASS_TREE,
init_tree="paddle.to_tensor",
method_name="cholesky_solve",
dtype_and_x=_get_second_matrix(),
dtype_and_y=_get_cholesky_matrix(),
)
def test_paddle_tensor_cholesky_solve(
dtype_and_x,
dtype_and_y,
frontend_method_data,
init_flags,
method_flags,
frontend,
on_device,
backend_fw,
):
input_dtype1, x = dtype_and_x
input_dtype2, y = dtype_and_y
helpers.test_frontend_method(
init_input_dtypes=[input_dtype1, input_dtype2],
backend_to_test=backend_fw,
init_all_as_kwargs_np={
"data": x,
},
method_input_dtypes=[input_dtype1, input_dtype2],
method_all_as_kwargs_np={
"y": y,
"upper": np.array_equal(y, np.triu(y)),
},
frontend_method_data=frontend_method_data,
init_flags=init_flags,
method_flags=method_flags,
frontend=frontend,
on_device=on_device,
rtol_=1e-3,
atol_=1e-3,
)


# tile
@handle_frontend_method(
class_tree=CLASS_TREE,
Expand Down

0 comments on commit 6a40b27

Please sign in to comment.