def _run_once(self, layer, criterion, *args):
    self._reset_seeds()
    layer.zero_grad()
    output = layer(*args)
    if isinstance(output, tuple):
        output = output[0]
    output = output.squeeze()
    y = torch.zeros_like(output)
    loss = criterion(output, y)
    loss.backward()
def _run_once(self, layer, criterion, *args):
    self._reset_seeds()
    layer.zero_grad()
    output = layer(*args)
    if isinstance(output, tuple):
        output = output[0]
    output = output.squeeze()
    y = torch.zeros_like(output)
    loss = criterion(output, y)
    loss.backward()