MCPcopy Index your code
hub / github.com/microsoft/TRELLIS / forward

Method forward

trellis/modules/sparse/norm.py:35–43  ·  view source on GitHub ↗
(self, input: SparseTensor)

Source from the content-addressed store, hash-verified

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)
37 for k in range(input.shape[0]):
38 bfeats = input.feats[input.layout[k]]
39 bfeats = bfeats.permute(1, 0).reshape(1, input.shape[1], -1)
40 bfeats = super().forward(bfeats)
41 bfeats = bfeats.reshape(input.shape[1], -1).permute(1, 0)
42 nfeats[input.layout[k]] = bfeats
43 return input.replace(nfeats)
44
45
46class SparseGroupNorm32(SparseGroupNorm):

Callers

nothing calls this directly

Calls 3

reshapeMethod · 0.80
replaceMethod · 0.80
forwardMethod · 0.45

Tested by

no test coverage detected