MCPcopy Create free account
hub / github.com/Tele-AI/Telechat / GeLUFunction

Class GeLUFunction

models/12B_8bit/modeling_telechat.py:297–307  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

295
296
297class GeLUFunction(torch.autograd.Function):
298 @staticmethod
299 def forward(ctx, input: torch.Tensor) -> torch.Tensor:
300 ctx.save_for_backward(input)
301 return telechat_gelu_forward(input)
302
303 @staticmethod
304 def backward(ctx, grad_output: torch.Tensor) -> torch.Tensor:
305 input = ctx.saved_tensors
306 tmp = telechat_gelu_back(grad_output, input)
307 return tmp
308
309
310class TelechatGelu(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected