fix(pt): convert torch.__version__ to str when serializing#4106
fix(pt): convert torch.__version__ to str when serializing#4106wanghan-iapcm merged 1 commit intodeepmodeling:develfrom
torch.__version__ to str when serializing#4106Conversation
```py
>>> type(torch.__version__)
<class 'torch.torch_version.TorchVersion'>
```
This causes a YAML error:
```
File "/home/jz748/anaconda3/lib/python3.10/site-packages/yaml/representer.py", line 231, in represent_undefined
raise RepresenterError("cannot represent an object", data)
yaml.representer.RepresenterError: ('cannot represent an object', '2.3.1+cu121')
```
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
WalkthroughWalkthroughThe change involves modifying the Changes
Recent review detailsConfiguration used: CodeRabbit UI Files selected for processing (1)
Files skipped from review due to trivial changes (1)
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? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## devel #4106 +/- ##
==========================================
- Coverage 83.01% 83.01% -0.01%
==========================================
Files 524 524
Lines 51642 51641 -1
Branches 3030 3030
==========================================
- Hits 42871 42868 -3
+ Misses 7825 7824 -1
- Partials 946 949 +3 ☔ View full report in Codecov by Sentry. |
…odeling#4106) ```py >>> type(torch.__version__) <class 'torch.torch_version.TorchVersion'> ``` This causes a YAML error: ``` File "/home/jz748/anaconda3/lib/python3.10/site-packages/yaml/representer.py", line 231, in represent_undefined raise RepresenterError("cannot represent an object", data) yaml.representer.RepresenterError: ('cannot represent an object', '2.3.1+cu121') ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Improved the serialization of the PyTorch version by ensuring it is represented as a string, enhancing data clarity and consistency. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
This causes a YAML error:
Summary by CodeRabbit