[PYTHON] Fix variable referenced before assignment error in blocksparse matmul backward (#90)
This commit is contained in:
committed by
Philippe Tillet
parent
d9112144b4
commit
1112e2526e
@@ -560,7 +560,9 @@ class _matmul(torch.autograd.Function):
|
|||||||
def backward(ctx, dc):
|
def backward(ctx, dc):
|
||||||
# saved for backward
|
# saved for backward
|
||||||
a, b = ctx.saved_tensors
|
a, b = ctx.saved_tensors
|
||||||
|
da, db = None, None
|
||||||
mode = ctx.mode
|
mode = ctx.mode
|
||||||
|
|
||||||
# gradients w.r.t. a
|
# gradients w.r.t. a
|
||||||
if ctx.needs_input_grad[0]:
|
if ctx.needs_input_grad[0]:
|
||||||
mode_da = mode[1] + mode[0] + mode[2]
|
mode_da = mode[1] + mode[0] + mode[2]
|
||||||
|
Reference in New Issue
Block a user