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

Class WanUpsample

architecture/autoencoder_kl_wan.py:205–217  ·  view source on GitHub ↗

r""" Perform upsampling while ensuring the output tensor has the same data type as the input. Args: x (torch.Tensor): Input tensor to be upsampled. Returns: torch.Tensor: Upsampled tensor with the same data type as the input.

Source from the content-addressed store, hash-verified

203
204
205class WanUpsample(nn.Upsample):
206 r"""
207 Perform upsampling while ensuring the output tensor has the same data type as the input.
208
209 Args:
210 x (torch.Tensor): Input tensor to be upsampled.
211
212 Returns:
213 torch.Tensor: Upsampled tensor with the same data type as the input.
214 """
215
216 def forward(self, x):
217 return super().forward(x.float()).type_as(x)
218
219
220class WanResample(nn.Module):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected