ran ruff formatter locally

This commit is contained in:
Nicolas Gorlo committed 2025-05-09 14:45:07 -04:00
1 parent f6d43ac606
commit 80003ca0ec
1 file changed
+2 -2
+2 -2
View File
@@ -29,13 +29,13 @@ class _TruncExp(Function):
# Implementation from torch-ngp:
# https://github.com/ashawkey/torch-ngp/blob/93b08a0d4ec1cc6e69d85df7f0acdfb99603b628/activation.py
@staticmethod
@custom_fwd(cast_inputs=torch.float32, device_type='cuda')
@custom_fwd(cast_inputs=torch.float32, device_type="cuda")
def forward(ctx, x):
ctx.save_for_backward(x)
return torch.exp(x)
@staticmethod
@custom_bwd(device_type='cuda')
@custom_bwd(device_type="cuda")
def backward(ctx, g):
x = ctx.saved_tensors[0]
return g * torch.exp(x.clamp(-15, 15))