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 array initialization problem when import package #49

Merged
merged 1 commit into from
Dec 13, 2024
Merged

Conversation

chaoming0625
Copy link
Member

This pull request introduces significant changes to the braintaichi/_primitive/_ad_support.py file, focusing on enhancing the functionality for defining JVP (Jacobian-vector product) rules for JAX primitives. The most important changes include the addition of new imports, a redefined defjvp function, and the implementation of helper functions to support the new functionality.

Enhancements to JVP rule definitions:

  • Added imports for functools, partial, jax, tree_util, and ad to support the new functionality.
  • Redefined the defjvp function to handle primitives with multiple_results=True and added an example reference for usage.
  • Implemented the _standard_jvp helper function to manage JVP rules for primitives with multiple results, ensuring compatibility with different versions of JAX.
  • Added the _add_tangents helper function to combine tangents using tree_util.tree_map and ad.add_tangents.

@chaoming0625 chaoming0625 merged commit a42340d into main Dec 13, 2024
24 checks passed
@chaoming0625 chaoming0625 deleted the update branch December 13, 2024 14:06
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

1 participant