Closed anyangml closed 2 months ago
The recent changes involve modifications to the return type of the eval
method in deepmd/infer/deep_tensor.py
, converting it from a single np.ndarray
to Tuple[np.ndarray]
. Additionally, the test_permutation.py
and test_finetune.py
test files have been updated to incorporate a new model_dipole
dictionary configuration, modify energy calculation requirements, and add new data requirements for "global_dipole."
Files | Change Summary |
---|---|
deepmd/infer/deep_tensor.py |
Changed the return type of eval method from np.ndarray to Tuple[np.ndarray] , returning values wrapped in tuples. |
source/tests/pt/model/test_permutation.py |
Added model_dipole dictionary with configurations for a dipole model. |
source/tests/pt/test_finetune.py |
Added model_dipole , new data requirements for "global_dipole," and modified energy calculations and class declarations. |
sequenceDiagram
participant Tester as Test Suite
participant DT as DeepTensor
participant ModelConfig as Model Configuration
rect rgb(191, 223, 255)
note over Tester, DT: Interaction for evaluating models
Tester ->> DT: Call eval()
DT -->> Tester: Return tuple of np.ndarray
end
rect rgb(245, 224, 177)
note over Tester, ModelConfig: Interaction for configuring models in tests
Tester ->> ModelConfig: Load model_dipole configuration
ModelConfig -->> Tester: Configurations returned
end
rect rgb(255, 191, 191)
note over Tester: Testing with new data requirements
Tester ->> Tester: Test with global_dipole
Tester ->> Tester: Adjust energy calculations
end
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Attention: Patch coverage is 0%
with 2 lines
in your changes missing coverage. Please review.
Project coverage is 34.83%. Comparing base (
1c3e099
) to head (aa5c20d
).
Files | Patch % | Lines |
---|---|---|
deepmd/infer/deep_tensor.py | 0.00% | 2 Missing :warning: |
:exclamation: There is a different number of reports uploaded between BASE (1c3e099) and HEAD (aa5c20d). Click for more details.
HEAD has 24 uploads less than BASE
| Flag | BASE (1c3e099) | HEAD (aa5c20d) | |------|------|------| ||26|2|
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
I may close this PR if ndarry is the expected output type.
Could you please explain the reason of using
Tuple[np.ndarray]
instead ofnp.ndarray
as returned type ofDeepTensor
?
It seems the other DeepModels all return a tuple object, I thought they should be consistent. When adding the new UT, DeepDipole eval needs special handling if a ndarray is returned. Although the UT is not as important, since dipole model does not apply bias, just want to check the changes made in #3945.
Summary by CodeRabbit
New Features
model_dipole
for enhanced dipole model configurations.Improvements
eval
method to ensure consistency and clarity in the output.Testing