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

Method __init__

diffsynth/models/sd_unet.py:95–106  ·  view source on GitHub ↗
(self, in_channels, out_channels, temb_channels=None, groups=32, eps=1e-5)

Source from the content-addressed store, hash-verified

93
94class ResnetBlock(torch.nn.Module):
95 def __init__(self, in_channels, out_channels, temb_channels=None, groups=32, eps=1e-5):
96 super().__init__()
97 self.norm1 = torch.nn.GroupNorm(num_groups=groups, num_channels=in_channels, eps=eps, affine=True)
98 self.conv1 = torch.nn.Conv2d(in_channels, out_channels, kernel_size=3, stride=1, padding=1)
99 if temb_channels is not None:
100 self.time_emb_proj = torch.nn.Linear(temb_channels, out_channels)
101 self.norm2 = torch.nn.GroupNorm(num_groups=groups, num_channels=out_channels, eps=eps, affine=True)
102 self.conv2 = torch.nn.Conv2d(out_channels, out_channels, kernel_size=3, stride=1, padding=1)
103 self.nonlinearity = torch.nn.SiLU()
104 self.conv_shortcut = None
105 if in_channels != out_channels:
106 self.conv_shortcut = torch.nn.Conv2d(in_channels, out_channels, kernel_size=1, stride=1, padding=0, bias=True)
107
108 def forward(self, hidden_states, time_emb, text_emb, res_stack, **kwargs):
109 x = hidden_states

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected