Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix frontends.torch.{h,v,d}split #10810

Merged
merged 4 commits into from
Feb 23, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -216,15 +216,15 @@ def split(tensor, split_size_or_sections, dim=0):


def _get_indices_or_sections(indices_or_sections, indices, sections):
if not indices_or_sections:
if isinstance(indices_or_sections, (list, tuple)):
pass
elif indices and not sections:
if not isinstance(indices_or_sections, (list, tuple, int)):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if not ivy.exists(indices_or_sections): is probably even better, I updated the previous comment but was too late it seems, sorry for that, we can merge after this little tweak:)

if indices and not sections:
indices_or_sections = indices
elif sections and not indices:
indices_or_sections = sections
else:
raise TypeError("got invalid argument for indices_or_sections")
raise ivy.utils.exception.IvyError(
"got invalid argument for indices_or_sections"
)
return indices_or_sections


Expand Down