(values)
| 89 | |
| 90 | # Transform update_values into sparse tensor |
| 91 | def make_sparse(values): |
| 92 | constructor = grad.new |
| 93 | if grad_indices.dim() == 0 or values.dim() == 0: |
| 94 | return constructor().resize_as_(grad) |
| 95 | return constructor(grad_indices, values, grad.size()) |
| 96 | |
| 97 | acc = state[_key(0)] |
| 98 | update_values = _compute_sparse_update( |