Skip to content

Commit

Permalink
FIX: non-contiguous gradients Closes #31
Browse files Browse the repository at this point in the history
Former-commit-id: ab06e72
  • Loading branch information
gpauloski committed Apr 22, 2021
1 parent 54179fc commit 99da3b5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kfac/layers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,9 +476,9 @@ def _get_precondition_gradient_inv(self):

def _set_bias_grad(self, grad):
"""Set bias.grad tensor of module"""
self.module.bias.grad = grad
self.module.bias.grad = grad.contiguous()

def _set_weight_grad(self, grad):
"""Set weight.grad tensor of module"""
self.module.weight.grad = grad
self.module.weight.grad = grad.contiguous()

0 comments on commit 99da3b5

Please sign in to comment.