MCPcopy Create free account
hub / github.com/microsoft/TRELLIS / norm_layer

Function norm_layer

trellis/models/sparse_structure_vae.py:10–19  ·  view source on GitHub ↗

Return a normalization layer.

(norm_type: str, *args, **kwargs)

Source from the content-addressed store, hash-verified

8
9
10def norm_layer(norm_type: str, *args, **kwargs) -> nn.Module:
11 """
12 Return a normalization layer.
13 """
14 if norm_type == "group":
15 return GroupNorm32(32, *args, **kwargs)
16 elif norm_type == "layer":
17 return ChannelLayerNorm32(*args, **kwargs)
18 else:
19 raise ValueError(f"Invalid norm type {norm_type}")
20
21
22class ResBlock3d(nn.Module):

Callers 3

__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85

Calls 2

GroupNorm32Class · 0.85
ChannelLayerNorm32Class · 0.85

Tested by

no test coverage detected