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

Add species to cloning of both beam classes #376

Merged
merged 8 commits into from
Mar 12, 2025

Conversation

jank324
Copy link
Member

@jank324 jank324 commented Mar 11, 2025

Description

Passes species in both beam classes clone method as well as to various track methods.

Motivation and Context

  • I have raised an issue to propose this change (required for new features and bug fixes)

Fixes #368 and fixes #371.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (update in the documentation)

Checklist

  • I have updated the changelog accordingly (required).
  • My change requires a change to the documentation.
  • I have updated the tests accordingly (required for a bug fix or a new feature).
  • I have updated the documentation accordingly.
  • I have reformatted the code and checked that formatting passes (required).
  • I have have fixed all issues found by flake8 (required).
  • I have ensured that all pytest tests pass (required).
  • I have run pytest on a machine with a CUDA GPU and made sure all tests pass (required).
  • I have checked that the documentation builds (required).

Note: We are using a maximum length of 88 characters per line.

@jank324 jank324 linked an issue Mar 11, 2025 that may be closed by this pull request
@jank324 jank324 added the bug Something isn't working label Mar 11, 2025
@jank324 jank324 requested a review from Hespe March 11, 2025 18:02
@jank324 jank324 marked this pull request as ready for review March 11, 2025 18:02
@jank324 jank324 self-assigned this Mar 11, 2025
Copy link
Member

@Hespe Hespe left a comment

Choose a reason for hiding this comment

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

Changes look mostly good to me, but there is one general thing we probably want to change before merging. Taking a deep copy of Species is likely problematic since its properties are stored as torch.Tensor which cannot be deepcopied if they are not leaf tensors. I assume this will work until we try to add gradients to any of the Species properties.

@jank324 jank324 merged commit 51e5080 into master Mar 12, 2025
8 checks passed
@jank324 jank324 deleted the 368-cloning-parameterbeam-does-not-preserve-species branch March 12, 2025 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Species is not passed along in Element.track Cloning ParameterBeam does not preserve species
2 participants