MCPcopy Create free account
hub / github.com/bbaaii/DreamDiffusion / IdentityFirstStage

Class IdentityFirstStage

code/dc_ldm/models/autoencoder.py:548–565  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

546
547
548class IdentityFirstStage(torch.nn.Module):
549 def __init__(self, *args, vq_interface=False, **kwargs):
550 self.vq_interface = vq_interface # TODO: Should be true by default but check to not break older stuff
551 super().__init__()
552
553 def encode(self, x, *args, **kwargs):
554 return x
555
556 def decode(self, x, *args, **kwargs):
557 return x
558
559 def quantize(self, x, *args, **kwargs):
560 if self.vq_interface:
561 return x, None, [None, None, None]
562 return x
563
564 def forward(self, x, *args, **kwargs):
565 return x

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected