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

Refactor some functions to support batch invocation on numpy arrays #55

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

EliaCereda
Copy link

This commit provides vectorized implementations for the following functions:

  • affines.compose
  • affines.decompose44
  • euler.euler2mat
  • euler.mat2euler

I tried to keep the code as close as possible to the current implementation, using idiomatic Numpy code to handle scalars and batches in a single code path. The functions accept inputs with an arbitrary number of batch dimensions in front of the expected input shape. Functions that expect a (3, 3) matrix, for example, will accept arrays with shape (..., 3, 3).

I propose to discuss any changes to bring these to a mergeable state, then same approach can be used to vectorize other functions in the library.

The changes should be backwards compatible and entirely transparent for existing users. Existing tests all pass, let me know if you had something specific in mind on additional tests for this functionality in #14.

This commit provides vectorized implementations for the following functions:
- affines.compose
- affines.decompose44
- euler.euler2mat
- euler.mat2euler
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.

1 participant