Skip to content

MAINT: automagically wrap return values to ndarrays / lists / tuples #92

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

Merged
merged 1 commit into from
Mar 27, 2023

Conversation

ev-br
Copy link
Collaborator

@ev-br ev-br commented Mar 23, 2023

An alternative to gh-83: Dispatch on the type of the return object, wrap tensors into arrays and sequences into sequences of arrays.

All this allows to inline _helpers.{to_tensors, array_from, tuple_arrays_from}

@ev-br ev-br requested a review from lezcano March 23, 2023 21:55
Copy link
Collaborator

@lezcano lezcano left a comment

Choose a reason for hiding this comment

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

This looks good but I think that we can still improve it. I think this could be done automatically for all the functions regardless of their output.

Also, the tiniest of nits, I don't know if "mangle" is the best word to describe this process :P

…of ndarrays

All this allows to inline _helpers.{to_tensors, array_from, tuple_arrays_from}

Co-authored-by: Mario Lezcano Casado <[email protected]>
Copy link
Collaborator

@lezcano lezcano left a comment

Choose a reason for hiding this comment

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

Great stuff!

@ev-br ev-br changed the title MAINT: automagically mangle return values to ndarrays / lists / tuples MAINT: automagically wrap return values to ndarrays / lists / tuples Mar 24, 2023
@ev-br
Copy link
Collaborator Author

ev-br commented Mar 27, 2023

Ok, let's get this in and finish up returns values/out arrays in a sequel

@ev-br ev-br merged commit 74523fa into main Mar 27, 2023
@ev-br ev-br deleted the mangle_returns branch March 27, 2023 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants