pytorch
155691a7 - Implement meta functions for rshift and lshift (#103637)

Commit
2 years ago
Implement meta functions for rshift and lshift (#103637) Fixes #103606 Was using this script to exercise new code, cause I can never remember which test it is. ``` import torch @torch.compile(fullgraph=True, dynamic=True) def shift_right(tensor: torch.Tensor) -> torch.Tensor: return (tensor >> 2).to(torch.long) def main(): sample_input = torch.tensor([4, 4, 16, 32], dtype=torch.uint8) print(shift_right(sample_input)) if __name__ == "__main__": main() ``` And iterated through the error messages Pull Request resolved: https://github.com/pytorch/pytorch/pull/103637 Approved by: https://github.com/ezyang
Author
Committer
Parents
Loading