Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a differentiable sparse matrix vector product on top of our ops #392

Merged
merged 5 commits into from
Dec 8, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix dtype index bug.
  • Loading branch information
luisenp committed Dec 8, 2022
commit 1e9dcb998b8dda79a8fcee0ad45a3f72d1faec1d
2 changes: 1 addition & 1 deletion theseus/utils/sparse_matrix_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def _sparse_mat_vec_bwd_backend(
for row in range(num_rows):
start = A_row_ptr[row]
end = A_row_ptr[row + 1]
columns = A_col_ind[start:end]
columns = A_col_ind[start:end].long()
if is_tmat:
A_grad[:, start:end] = v[:, row].view(-1, 1) * grad_output[:, columns]
v_grad[:, row] = (grad_output[:, columns] * A_val[:, start:end]).sum(dim=1)
Expand Down