MCPcopy Create free account
hub / github.com/cientgu/VQ-Diffusion / encode

Method encode

image_synthesis/taming/modules/util.py:124–130  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

122 self.quantize_interface = quantize_interface
123
124 def encode(self, x):
125 # get batch size from data and replicate sos_token
126 c = torch.ones(x.shape[0], 1)*self.sos_token
127 c = c.long().to(x.device)
128 if self.quantize_interface:
129 return c, None, [None, None, c]
130 return c

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected