MCPcopy Create free account
hub / github.com/MoonInTheRiver/DiffSinger / backward

Method backward

modules/commons/common_layers.py:475–478  ·  view source on GitHub ↗
(ctx, grad_output)

Source from the content-addressed store, hash-verified

473
474 @staticmethod
475 def backward(ctx, grad_output):
476 i = ctx.saved_variables[0]
477 sigmoid_i = torch.sigmoid(i)
478 return grad_output * (sigmoid_i * (1 + i * (1 - sigmoid_i)))
479
480
481class CustomSwish(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected