Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix bugs in export docstrings (pytorch#110169)
First error ``` Traceback (most recent call last): File "/home/ubuntu/exporty.py", line 8, in <module> ep = torch.export.export(MyModule(), torch.randn(5)) File "/opt/conda/envs/sam/lib/python3.10/site-packages/torch/export/__init__.py", line 509, in export return export(f, args, kwargs, constraints) File "/opt/conda/envs/sam/lib/python3.10/site-packages/torch/_export/__init__.py", line 314, in export raise UserError(UserErrorType.INVALID_INPUT, torch._dynamo.exc.UserError: Expecting `args` to be a tuple of example positional inputs, got <class 'torch.Tensor'> ``` Second error ``` (sam) ubuntu@ip-172-31-9-217:~$ python exporty.py Traceback (most recent call last): File "/home/ubuntu/exporty.py", line 13, in <module> torch.export.save(ep, 'exported_program.pt2', extra_files=extra_files) File "/opt/conda/envs/sam/lib/python3.10/site-packages/torch/export/__init__.py", line 566, in save save(ep, f, extra_files=extra_files, opset_version=opset_version) File "/opt/conda/envs/sam/lib/python3.10/site-packages/torch/_export/__init__.py", line 595, in save encoded_content = content.encode('utf-8') AttributeError: 'bytes' object has no attribute 'encode'. Did you mean: 'decode'? ``` Pull Request resolved: pytorch#110169 Approved by: https://github.com/angelayi
- Loading branch information