(self, normalized_shape, eps=1e-5, elementwise_affine=True)
| 30 | |
| 31 | class SparseLayerNorm(nn.LayerNorm): |
| 32 | def __init__(self, normalized_shape, eps=1e-5, elementwise_affine=True): |
| 33 | super(SparseLayerNorm, self).__init__(normalized_shape, eps, elementwise_affine) |
| 34 | |
| 35 | def forward(self, input: SparseTensor) -> SparseTensor: |
| 36 | nfeats = torch.zeros_like(input.feats) |