MCPcopy Create free account
hub / github.com/OpenDriveLab/ReSim / Residual

Class Residual

sat/sgm/modules/autoencoding/magvit2_pytorch.py:186–193  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

184
185
186class Residual(Module):
187 @beartype
188 def __init__(self, fn: Module):
189 super().__init__()
190 self.fn = fn
191
192 def forward(self, x, **kwargs):
193 return self.fn(x, **kwargs) + x
194
195
196# for a bunch of tensor operations to change tensor to (batch, time, feature dimension) and back

Callers 6

__init__Method · 0.85
ResidualUnitFunction · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected