MCPcopy
hub / github.com/Robbyant/lingbot-world / forward

Method forward

wan/modules/vae2_2.py:389–411  ·  view source on GitHub ↗
(self, x: torch.Tensor, first_chunk=False)

Source from the content-addressed store, hash-verified

387 self.repeats = out_channels * self.factor // in_channels
388
389 def forward(self, x: torch.Tensor, first_chunk=False) -> torch.Tensor:
390 x = x.repeat_interleave(self.repeats, dim=1)
391 x = x.view(
392 x.size(0),
393 self.out_channels,
394 self.factor_t,
395 self.factor_s,
396 self.factor_s,
397 x.size(2),
398 x.size(3),
399 x.size(4),
400 )
401 x = x.permute(0, 1, 5, 2, 6, 3, 7, 4).contiguous()
402 x = x.view(
403 x.size(0),
404 self.out_channels,
405 x.size(2) * self.factor_t,
406 x.size(4) * self.factor_s,
407 x.size(6) * self.factor_s,
408 )
409 if first_chunk:
410 x = x[:, :, self.factor_t - 1:, :, :]
411 return x
412
413
414class Down_ResidualBlock(nn.Module):

Callers 2

forwardMethod · 0.45
forwardMethod · 0.45

Calls 1

sizeMethod · 0.80

Tested by

no test coverage detected