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 + add argument to pad for pytorch backend #1997

Merged
merged 1 commit into from May 21, 2024

Conversation

FlorianPfaff
Copy link
Contributor

@FlorianPfaff FlorianPfaff commented May 7, 2024

Checklist

  • My pull request has a clear and explanatory title.
  • If necessary, my code is vectorized.
  • I added appropriate unit tests.
  • I made sure the code passes all unit tests. No, but I'm not sure if that might be some random failure?
  • My PR follows PEP8 guidelines. (refer to comment below)
  • My PR follows geomstats coding style and API.
  • My code is properly documented and I made sure the documentation renders properly. (Link)
  • I linked to issues and PRs that are relevant to this PR.

Description

In the pytroch backend, the argument used for padding values was "constant_value". However, the naming in jax and numpy is constant_values. See https://numpy.org/doc/stable/reference/generated/numpy.pad.html
and https://jax.readthedocs.io/en/latest/_autosummary/jax.numpy.pad.html. I also added passing on the "mode" argument, which is supported by pytorch.

Issue

This patch ensures that passing "constant_values" is compatible with all backends.

Additional context

Copy link
Collaborator

@luisfpereira luisfpereira left a comment

Choose a reason for hiding this comment

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

Thank you @FlorianPfaff. Merging. (Sorry for taking so long.)

@luisfpereira luisfpereira merged commit 929c0b1 into geomstats:main May 21, 2024
8 of 9 checks passed
@FlorianPfaff FlorianPfaff deleted the pad-pytorch-fix branch May 21, 2024 11:27
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.

None yet

2 participants