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

yaml.dump(torch.float32) produces a ValueError from Representer.represent_object #827

Open
vttrifonov opened this issue Aug 25, 2024 · 1 comment

Comments

@vttrifonov
Copy link

import torch
import yaml
yaml.dump(torch.float32)

produces

ValueError: dictionary update sequence element #0 has length 1; 2 is required

The issue is that torch.float32.__reduce_ex__ returns just a string and not a tuple. This is allowed by the pickle API but not handled right by PyYAML.

@yeren66
Copy link

yeren66 commented Sep 2, 2024

meet the same error

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

No branches or pull requests

2 participants