MCPcopy Create free account
hub / github.com/BICLab/SpikingBrain-7B / SquaredReLUFunction

Class SquaredReLUFunction

W8ASpike/activations.py:288–298  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

286
287
288class SquaredReLUFunction(torch.autograd.Function):
289
290 @staticmethod
291 def forward(ctx, input):
292 ctx.save_for_backward(input)
293 return sqrelu_fwd(input)
294
295 @staticmethod
296 def backward(ctx, grad_output):
297 input, = ctx.saved_tensors
298 return sqrelu_bwd(grad_output, input)
299
300
301sqrelu = SquaredReLUFunction.apply

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected