MCPcopy
hub / github.com/TencentARC/Pixal3D / forward

Method forward

pixal3d/modules/sparse/norm.py:34–42  ·  view source on GitHub ↗
(self, input: VarLenTensor)

Source from the content-addressed store, hash-verified

32 super(SparseLayerNorm, self).__init__(normalized_shape, eps, elementwise_affine)
33
34 def forward(self, input: VarLenTensor) -> VarLenTensor:
35 nfeats = torch.zeros_like(input.feats)
36 for k in range(input.shape[0]):
37 bfeats = input.feats[input.layout[k]]
38 bfeats = bfeats.permute(1, 0).reshape(1, input.shape[1], -1)
39 bfeats = super().forward(bfeats)
40 bfeats = bfeats.reshape(input.shape[1], -1).permute(1, 0)
41 nfeats[input.layout[k]] = bfeats
42 return input.replace(nfeats)
43
44
45class SparseGroupNorm32(SparseGroupNorm):

Callers

nothing calls this directly

Calls 3

reshapeMethod · 0.45
forwardMethod · 0.45
replaceMethod · 0.45

Tested by

no test coverage detected