| 295 | |
| 296 | |
| 297 | class 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 | |
| 310 | class TelechatGelu(nn.Module): |
nothing calls this directly
no outgoing calls
no test coverage detected