clamp in place

This commit is contained in:
Brett Kuprel
2022-07-10 08:07:54 -04:00
parent 247c41be17
commit 1ffdef9a56
6 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -166,7 +166,7 @@ class VQGanDetokenizer(Module):
self.decoder = Decoder()
def forward(self, z: LongTensor) -> FloatTensor:
z = z.clamp(0, self.vocab_count - 1)
z.clamp_(0, self.vocab_count - 1)
z = self.embedding.forward(z)
z = z.view((z.shape[0], 2 ** 4, 2 ** 4, 2 ** 8))
z = z.permute(0, 3, 1, 2).contiguous()