diff --git a/nerfstudio/field_components/activations.py b/nerfstudio/field_components/activations.py index 5a483b3b9..371999094 100644 --- a/nerfstudio/field_components/activations.py +++ b/nerfstudio/field_components/activations.py @@ -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))