MCPcopy
hub / github.com/deep-floyd/IF / get_activation

Function get_activation

deepfloyd_if/model/nn.py:32–42  ·  view source on GitHub ↗
(activation)

Source from the content-addressed store, hash-verified

30
31
32def get_activation(activation):
33 if activation == 'silu':
34 return torch.nn.SiLU()
35 elif activation == 'gelu_jit':
36 return GELUJit()
37 elif activation == 'gelu':
38 return torch.nn.GELU()
39 elif activation == 'none':
40 return torch.nn.Identity()
41 else:
42 raise ValueError(f'unknown activation type {activation}')
43
44
45class GroupNorm32(nn.GroupNorm):

Callers 3

__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85

Calls 1

GELUJitClass · 0.85

Tested by

no test coverage detected