MCPcopy Create free account
hub / github.com/OpenImagingLab/FlashVSR / __init__

Method __init__

examples/WanVSR/utils/TCDecoder.py:26–32  ·  view source on GitHub ↗
(self, C, kernel_size=3, bias=False)

Source from the content-addressed store, hash-verified

24class IdentityConv2d(nn.Conv2d):
25 """Same-shape Conv2d initialized to identity (Dirac)."""
26 def __init__(self, C, kernel_size=3, bias=False):
27 pad = kernel_size // 2
28 super().__init__(C, C, kernel_size, padding=pad, bias=bias)
29 with torch.no_grad():
30 init.dirac_(self.weight)
31 if self.bias is not None:
32 self.bias.zero_()
33
34def conv(n_in, n_out, **kwargs):
35 return nn.Conv2d(n_in, n_out, 3, padding=1, **kwargs)

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected