MCPcopy Create free account
hub / github.com/MegaScenes/nvs / IdentityFirstStage

Class IdentityFirstStage

ldm/models/autoencoder.py:428–445  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

426
427
428class IdentityFirstStage(torch.nn.Module):
429 def __init__(self, *args, vq_interface=False, **kwargs):
430 self.vq_interface = vq_interface # TODO: Should be true by default but check to not break older stuff
431 super().__init__()
432
433 def encode(self, x, *args, **kwargs):
434 return x
435
436 def decode(self, x, *args, **kwargs):
437 return x
438
439 def quantize(self, x, *args, **kwargs):
440 if self.vq_interface:
441 return x, None, [None, None, None]
442 return x
443
444 def forward(self, x, *args, **kwargs):
445 return x

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected