MCPcopy Create free account
hub / github.com/NineAbyss/ZeroG / obtain_norm

Function obtain_norm

code/utils.py:205–216  ·  view source on GitHub ↗

Return normalization function module

(name)

Source from the content-addressed store, hash-verified

203
204
205def obtain_norm(name):
206 """
207 Return normalization function module
208 """
209 if name == "layernorm":
210 norm = nn.LayerNorm
211 elif name == "batchnorm":
212 norm = nn.BatchNorm1d
213 else:
214 raise NotImplementedError("{} is not implemented.".format(name))
215
216 return norm
217
218
219# ======================================================================

Callers 1

__init__Method · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected