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

JAX fix a (rare) bug related to vmap of tensor_product #73

Merged
merged 1 commit into from
Jan 23, 2025

Conversation

mariogeiger
Copy link
Collaborator

in some rare cases of repeated inputs like this:

def h(x):
    d = cue.descriptors.spherical_harmonics(cue.SO3(1), [2]).d
    return cuex.tensor_product(d, x, x)

jax.jacobian(h)(jnp.array([1.0, 0.0, 0.0]))

For the operand 0, the input and output have different leading shapes.

This was unfortunately not allowed, this PR changes this

@mariogeiger mariogeiger merged commit bcc2847 into main Jan 23, 2025
11 checks passed
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