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

refactorize NativeLayer, interface does not rely on the platform #3138

Merged
merged 1 commit into from
Jan 13, 2024

Conversation

wanghan-iapcm
Copy link
Collaborator

  • add parameter shape consistency check for layer
  • add input-output shape consistency check for net

deepmd_utils/model_format/network.py Dismissed Show resolved Hide resolved
self.b1 = np.full((3,), 4.0)
self.idt0 = np.full((2,), 4.0)
with self.assertRaises(ValueError) as context:
network = NativeLayer.deserialize(

Check warning

Code scanning / CodeQL

Variable defined multiple times Warning test

This assignment to 'network' is unnecessary as it is
redefined
before this value is used.
)
assert "not equalt to shape of b" in context.exception
with self.assertRaises(ValueError) as context:
network = NativeLayer.deserialize(

Check notice

Code scanning / CodeQL

Unused local variable Note test

Variable network is not used.
np.testing.assert_array_equal(network[0]["activation_function"], "tanh")
np.testing.assert_array_equal(network[1]["activation_function"], "tanh")
np.testing.assert_array_equal(network[0]["resnet"], True)
np.testing.assert_array_equal(network[1]["resnet"], True)

def test_shape_error(self):
with self.assertRaises(ValueError) as context:
network = NativeNet.deserialize(

Check notice

Code scanning / CodeQL

Unused local variable Note test

Variable network is not used.
Copy link

codecov bot commented Jan 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (308f97e) 76.15% compared to head (5fbca37) 76.18%.

Additional details and impacted files
@@            Coverage Diff             @@
##            devel    #3138      +/-   ##
==========================================
+ Coverage   76.15%   76.18%   +0.02%     
==========================================
  Files         252      252              
  Lines       25345    25368      +23     
  Branches     1579     1579              
==========================================
+ Hits        19302    19326      +24     
+ Misses       5118     5117       -1     
  Partials      925      925              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@wanghan-iapcm wanghan-iapcm merged commit 15117a0 into deepmodeling:devel Jan 13, 2024
46 checks passed
@wanghan-iapcm wanghan-iapcm deleted the mdfmt-refact-layer branch January 13, 2024 06:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants