MCPcopy Create free account
hub / github.com/OpenMOSS/MOSS / execute

Method execute

models_jittor/utils.py:8–14  ·  view source on GitHub ↗
(self, input)

Source from the content-addressed store, hash-verified

6class NewGELUActivation(jt.Module):
7
8 def execute(self, input):
9
10 output = (input + 0.044715 * jt.pow(input.float(), 3))
11 if jt.flags.amp_level >= 1:
12 output = output.half()
13
14 return 0.5 * input * (1.0 + jt.tanh(math.sqrt(2.0 / math.pi) * output))
15
16def fixed_pos_embedding(x, seq_dim=1, seq_len=None):
17 dim = x.shape[-1]

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected