Skip to content

Commit

Permalink
fix: Raised exception statements that are Unraised (#27279)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sai-Suraj-27 authored Nov 14, 2023
1 parent 6458919 commit d1d471d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ivy/functional/backends/torch/elementwise.py
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ def trapz(
return torch.trapezoid(y, dx=dx, dim=axis)
else:
if dx is not None:
TypeError(
raise TypeError(
"trapezoid() received an invalid combination of arguments - got "
"(Tensor, Tensor, int), but expected one of: *(Tensor "
"y, Tensor x, *, int dim) * (Tensor y, *, Number dx, int dim)"
Expand Down
6 changes: 3 additions & 3 deletions ivy/functional/frontends/tensorflow/ragged/ragged.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ def from_row_splits(cls, values, row_splits, name=None, validate=True):

if values.shape[0] != row_splits[-1] or row_splits[0] != 0:
if values.shape[0] != row_splits[-1]:
ivy.utils.exceptions.IvyException(
raise ivy.utils.exceptions.IvyException(
"first dimension of shape of values should be equal to the"
" last dimension of row_splits"
)
else:
ivy.utils.exceptions.IvyException(
raise ivy.utils.exceptions.IvyException(
"first value of row_splits should be equal to zero."
)
data = [
Expand All @@ -49,7 +49,7 @@ def from_row_lengths(
):
# TODO : modify this, if necessary, to accept raggedTensor inputs too
if sum(row_lengths) != values.shape[0]:
ivy.utils.exceptions.IvyException(
raise ivy.utils.exceptions.IvyException(
"first dimension of values should be equal to sum(row_lengths) "
)
data = []
Expand Down

0 comments on commit d1d471d

Please sign in to comment.