Skip to content

Only track non-scalar attributes in UNVECTORIZED_NUM_ATTR_DIMS#627

Draft
cr-xu wants to merge 2 commits intomasterfrom
626-bug-some-attrs-not-in-the-unvectorized_num_attr_dims
Draft

Only track non-scalar attributes in UNVECTORIZED_NUM_ATTR_DIMS#627
cr-xu wants to merge 2 commits intomasterfrom
626-bug-some-attrs-not-in-the-unvectorized_num_attr_dims

Conversation

@cr-xu
Copy link
Copy Markdown
Member

@cr-xu cr-xu commented Mar 20, 2026

Description

  • Remove default zeros in Beam.UNVECTORIZED_NUM_ATTR_DIMS and only track attributes with non-zero dimension in ParticleBeam and ParameterBeam;
  • Introduce a defining_features property in the same fashion as for Elements.
  • Simply some unit tests by using the defining_features property in beam classes to verify dtypes and devices are tracked properly. All the tested attributes are generateed from these definiing_features and the test was bit redundant.

Motivation and Context

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

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.

…ntroducing a defining_features property in beam classes;
@cr-xu cr-xu linked an issue Mar 20, 2026 that may be closed by this pull request
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.

Bug: Some attrs not in the UNVECTORIZED_NUM_ATTR_DIMS

1 participant