Commit 6330a2f
feat(tf2): support DPA4 descriptor (deepmodeling#5749)
## Summary
- Add and register the TF2 DPA4/SeZM descriptor adapter and its
TensorFlow-backed submodule mappings.
- Add the TensorFlow array operations, dynamic-shape handling, and
trackable parameter support required by the DPA4 descriptor.
- Enable TF2 coverage in the existing DPA4 descriptor consistency tests
and add focused descriptor state, checkpoint, graph-shape, and
array-operation tests.
- Keep this pull request descriptor-only; fitting, model factory,
trainer, and model-conversion changes are excluded.
## Validation
- ruff format .
- ruff check .
- python -m py_compile deepmd/dpmodel/array_api.py
deepmd/dpmodel/descriptor/dpa4.py
deepmd/dpmodel/descriptor/dpa4_nn/so2.py deepmd/tf2/common.py
deepmd/tf2/descriptor/dpa4.py
source/tests/consistent/descriptor/test_dpa4.py
source/tests/consistent/test_array_api.py source/tests/tf2/test_dpa4.py
- DP_TEST_TF2_ONLY=1 pytest source/tests/tf2/test_dpa4.py -v — 6 passed
- DP_TEST_TF2_ONLY=1 pytest
source/tests/consistent/test_array_api.py::TestXpMaximumAtConsistent::test_tf_preserves_all_negative_infinity_segment
-v — 1 passed
Coding agent: Codex
Codex version: codex-cli 0.144.4
Model: gpt-5.6-sol
Reasoning effort: xhigh
---------
Co-authored-by: njzjz-bot <njzjz.bot@gmail.com>
Co-authored-by: njzjz-bot <njzjz-bot@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: OutisLi <137472077+OutisLi@users.noreply.github.com>1 parent 9bc4eb5 commit 6330a2f
11 files changed
Lines changed: 996 additions & 19 deletions
File tree
- deepmd
- dpmodel
- descriptor/dpa4_nn
- tf2
- descriptor
- train
- source/tests
- consistent
- descriptor
- tf2
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
204 | 220 | | |
205 | 221 | | |
206 | 222 | | |
| |||
270 | 286 | | |
271 | 287 | | |
272 | 288 | | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
273 | 335 | | |
274 | 336 | | |
275 | 337 | | |
| |||
337 | 399 | | |
338 | 400 | | |
339 | 401 | | |
340 | | - | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
346 | 408 | | |
347 | 409 | | |
348 | 410 | | |
| |||
360 | 422 | | |
361 | 423 | | |
362 | 424 | | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
363 | 437 | | |
364 | 438 | | |
365 | 439 | | |
| |||
368 | 442 | | |
369 | 443 | | |
370 | 444 | | |
371 | | - | |
372 | 445 | | |
373 | 446 | | |
374 | 447 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
665 | 665 | | |
666 | 666 | | |
667 | 667 | | |
668 | | - | |
| 668 | + | |
669 | 669 | | |
670 | 670 | | |
671 | 671 | | |
| |||
744 | 744 | | |
745 | 745 | | |
746 | 746 | | |
747 | | - | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
748 | 780 | | |
749 | | - | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
750 | 786 | | |
751 | 787 | | |
752 | 788 | | |
| |||
755 | 791 | | |
756 | 792 | | |
757 | 793 | | |
758 | | - | |
759 | | - | |
760 | | - | |
| 794 | + | |
761 | 795 | | |
762 | 796 | | |
763 | | - | |
764 | | - | |
765 | | - | |
| 797 | + | |
766 | 798 | | |
767 | 799 | | |
768 | 800 | | |
| |||
791 | 823 | | |
792 | 824 | | |
793 | 825 | | |
794 | | - | |
| 826 | + | |
795 | 827 | | |
796 | 828 | | |
797 | 829 | | |
798 | 830 | | |
799 | | - | |
| 831 | + | |
800 | 832 | | |
801 | 833 | | |
802 | 834 | | |
| |||
0 commit comments