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

Function LayerNorm

modules/commons/common_layers.py:70–77  ·  view source on GitHub ↗
(normalized_shape, eps=1e-5, elementwise_affine=True, export=False)

Source from the content-addressed store, hash-verified

68
69
70def LayerNorm(normalized_shape, eps=1e-5, elementwise_affine=True, export=False):
71 if not export and torch.cuda.is_available():
72 try:
73 from apex.normalization import FusedLayerNorm
74 return FusedLayerNorm(normalized_shape, eps, elementwise_affine)
75 except ImportError:
76 pass
77 return torch.nn.LayerNorm(normalized_shape, eps, elementwise_affine)
78
79
80def Linear(in_features, out_features, bias=True):

Callers 2

__init__Method · 0.70
__init__Method · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected