forked from pytorch/FBGEMM
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix non-contiguous tensor problem in jagged_index_select (pytorch#2060)
Summary: Pull Request resolved: pytorch#2060 Before this diff, `jagged_index_select` kernels take raw pointers as arguments. This requires the input tensors to be contiguous. However, the `jagged_index_select` operator did not make sure that the tensors are contiguous before extracting and passing the raw pointers to the kernels causing the correctness issue. This diff replaces the raw pointer arguments with PyTorch's `PackedTensorAccessor` which handles non-contiguous tensor accesses automatically. For some tensors that their raw pointers are still being used, the operator makes sure that the tensors are contiguous before using them. Reviewed By: choudharydhruv Differential Revision: D49937274 fbshipit-source-id: dcdc751191ae17e3697b99d30145c67ab470a218
- Loading branch information
1 parent
2b04682
commit 8f7d8c7
Showing
3 changed files
with
74 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters