Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix torch_dispatch issue in group_index_select_dim0_gpu_backward (pyt…
…orch#2767) Summary: Pull Request resolved: pytorch#2767 The group_index_select_dim0_gpu_backward returns tensor list with undefined tensor. It is not compatible to ```__torch_dispatch__``` which call into Python from C++. The undefined tensors in the vector become None in Python. Once it returns to C++ call stack, It can't convert ```[None,None, Tensor]``` back to ```std::vector<at::Tensor>```. To solve this problem, the group_index_select_dim0_gpu_backward must return valid tensor list without undefined tensors (the diff used tensor with size {0}). It can set the variable_list to undefined tensor after returned from the pytorch dispatcher, which is a common scenario I have seen in other ops. Reviewed By: sryap Differential Revision: D58761943 fbshipit-source-id: 6dcd7a75023d667db9e80685ca82b6a572620148
- Loading branch information