MCPcopy Create free account
hub / github.com/UVA-Computer-Vision-Lab/FrameINO / forward

Method forward

architecture/autoencoder_kl_wan.py:109–131  ·  view source on GitHub ↗
(self, x: torch.Tensor, first_chunk=False)

Source from the content-addressed store, hash-verified

107 self.repeats = out_channels * self.factor // in_channels
108
109 def forward(self, x: torch.Tensor, first_chunk=False) -> torch.Tensor:
110 x = x.repeat_interleave(self.repeats, dim=1)
111 x = x.view(
112 x.size(0),
113 self.out_channels,
114 self.factor_t,
115 self.factor_s,
116 self.factor_s,
117 x.size(2),
118 x.size(3),
119 x.size(4),
120 )
121 x = x.permute(0, 1, 5, 2, 6, 3, 7, 4).contiguous()
122 x = x.view(
123 x.size(0),
124 self.out_channels,
125 x.size(2) * self.factor_t,
126 x.size(4) * self.factor_s,
127 x.size(6) * self.factor_s,
128 )
129 if first_chunk:
130 x = x[:, :, self.factor_t - 1 :, :, :]
131 return x
132
133
134class WanCausalConv3d(nn.Conv3d):

Callers 2

forwardMethod · 0.45
forwardMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected