MCPcopy Create free account
hub / github.com/JasonLSC/GSCodec_Studio / forward

Method forward

gsplat/compression_simulation/ops.py:80–87  ·  view source on GitHub ↗
(ctx, input)

Source from the content-addressed store, hash-verified

78class STE_binary(torch.autograd.Function):
79 @staticmethod
80 def forward(ctx, input):
81 ctx.save_for_backward(input)
82 input = torch.clamp(input, min=-1, max=1)
83 # out = torch.sign(input)
84 p = (input >= 0) * (+1.0)
85 n = (input < 0) * (-1.0)
86 out = p + n
87 return out
88 @staticmethod
89 def backward(ctx, grad_output):
90 # mask: to ensure x belongs to (-1, 1)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected