Add support for parsing torch.Generator in JIT#140489
Add support for parsing torch.Generator in JIT#140489antoniojkim wants to merge 2 commits intopytorch:mainfrom
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/140489
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ✅ No FailuresAs of commit 4b6c913 with merge base a8a1e58 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
18674f2 to
ecec621
Compare
ecec621 to
3d9c83c
Compare
davidberard98
left a comment
There was a problem hiding this comment.
LGTM, can you add a few more tests though?
test/test_jit.py
Outdated
There was a problem hiding this comment.
iiuc seed can be in [-2^63, 2^64) or perhaps [0, 2^64). Can you test some large seeds to see if the parser works?
e.g.:
- if you serialize a torchscript graph for a generator with a negative seed, is its value remapped to a positive value?
- can the parser work with a seed > 2^63 ?
There was a problem hiding this comment.
Technically seed can be [0, 2^64). However, the scalar parser only supports signed integers. So, the parser is constrained to [0, 2^63). However, that is good enough for my purposes. I've added tests for these cases
3d9c83c to
4b6c913
Compare
|
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Fixes pytorch#140420 Pull Request resolved: pytorch#140489 Approved by: https://github.com/davidberard98
Fixes #140420
cc @EikanWang @jgong5 @wenzhe-nrv @sanchitintel