MCPcopy Create free account
hub / github.com/UX-Decoder/Semantic-SAM / _get_activation_fn

Function _get_activation_fn

semantic_sam/body/decoder/modules.py:175–183  ·  view source on GitHub ↗

Return an activation function given a string

(activation)

Source from the content-addressed store, hash-verified

173
174
175def _get_activation_fn(activation):
176 """Return an activation function given a string"""
177 if activation == "relu":
178 return F.relu
179 if activation == "gelu":
180 return F.gelu
181 if activation == "glu":
182 return F.glu
183 raise RuntimeError(F"activation should be relu/gelu, not {activation}.")
184
185
186class MLP(nn.Module):

Callers 4

__init__Method · 0.70
__init__Method · 0.70
__init__Method · 0.70
__init__Method · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected