Gaussian error linear unit, torch.erf
Easy FundamentalsImplement the GELU (Gaussian Error Linear Unit) activation.
• Do NOT use F.gelu, nn.GELU, or torch.nn.functional.gelu
• Use torch.erf for the exact version
Implement the function below. Use only basic PyTorch operations.
Use this code to debug before submitting.
Try solving it yourself first! Click below to reveal the solution.
For interactive practice with auto-grading, run TorchCode locally:pip install torch-judge then use check("gelu")
Gaussian error linear unit, torch.erf