mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-18 13:53:44 +08:00
ran ruff formatter locally
This commit is contained in:
1 parent
f6d43ac606
commit
80003ca0ec
1 file changed
+2
-2
@@ -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))
|
||||
|
||||
Reference in new issue
Block a user