MCPcopy Create free account
hub / github.com/294coder/Dif-PAN / __init__

Method __init__

models/unet_model_google.py:146–155  ·  view source on GitHub ↗
(self, in_channel, n_head=1, norm_groups=32)

Source from the content-addressed store, hash-verified

144
145class SelfAttention(nn.Module):
146 def __init__(self, in_channel, n_head=1, norm_groups=32):
147 super().__init__()
148
149 self.n_head = n_head
150
151 # self.norm = nn.BatchNorm2d(in_channel)
152 self.norm = nn.GroupNorm(norm_groups, in_channel)
153 # self.norm = LayerNorm2d(in_channel)
154 self.qkv = nn.Conv2d(in_channel, in_channel * 3, 1, bias=False)
155 self.out = nn.Conv2d(in_channel, in_channel, 1)
156
157 def forward(self, input):
158 batch, channel, height, width = input.shape

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected