Fix to print statement

This commit is contained in:
Daniel Povey 2022-12-16 18:07:43 +08:00
parent 4eb3e97848
commit b9326e1ef2

View File

@ -799,7 +799,7 @@ class WithLoss(torch.autograd.Function):
ctx.y_shape = y.shape ctx.y_shape = y.shape
if random.random() < 0.002 and name is not None: if random.random() < 0.002 and name is not None:
loss_sum = y.sum().item() loss_sum = y.sum().item()
logging.info(f"WithLoss: name={ctx.name}, loss-sum={loss_sum:.3e}") logging.info(f"WithLoss: name={name}, loss-sum={loss_sum:.3e}")
return x return x
@staticmethod @staticmethod
def backward(ctx, ans_grad: Tensor): def backward(ctx, ans_grad: Tensor):