| 24 | } |
| 25 | |
| 26 | at::Tensor grouping_backward(at::Tensor grad_y, at::Tensor indices, |
| 27 | const int n) { |
| 28 | CHECK_CUDA(grad_y); |
| 29 | CHECK_CUDA(indices); |
| 30 | CHECK_CONTIGUOUS(grad_y); |
| 31 | CHECK_CONTIGUOUS(indices); |
| 32 | CHECK_IS_FLOAT(grad_y); |
| 33 | CHECK_IS_INT(indices); |
| 34 | |
| 35 | int b = grad_y.size(0); |
| 36 | int c = grad_y.size(1); |
| 37 | int m = indices.size(1); |
| 38 | int u = indices.size(2); |
| 39 | at::Tensor grad_x = torch::zeros( |
| 40 | {b, c, n}, at::device(grad_y.device()).dtype(at::ScalarType::Float)); |
| 41 | grouping_grad(b, c, n, m, u, grad_y.data_ptr<float>(), |
| 42 | indices.data_ptr<int>(), grad_x.data_ptr<float>()); |
| 43 | return grad_x; |
| 44 | } |
nothing calls this directly
no outgoing calls
no test coverage detected