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

Method __init__

models/unet_model_google.py:180–202  ·  view source on GitHub ↗
(
        self,
        dim,
        dim_out,
        *,
        time_emb_dim=None,
        norm_groups=32,
        dropout=0,
        with_attn=False,
        attn_guide=False,
    )

Source from the content-addressed store, hash-verified

178
179class ResnetBlocWithAttn(nn.Module):
180 def __init__(
181 self,
182 dim,
183 dim_out,
184 *,
185 time_emb_dim=None,
186 norm_groups=32,
187 dropout=0,
188 with_attn=False,
189 attn_guide=False,
190 ):
191 super().__init__()
192 self.with_attn = with_attn
193 self.res_block = ResnetBlock(
194 dim,
195 dim_out,
196 time_emb_dim,
197 norm_groups=norm_groups,
198 dropout=dropout,
199 attn_guide=attn_guide,
200 )
201 if with_attn:
202 self.attn = SelfAttention(dim_out, norm_groups=norm_groups, nhead=8)
203
204 def forward(self, x, time_emb, guidance=None):
205 x = self.res_block(x, time_emb, guidance)

Callers

nothing calls this directly

Calls 3

ResnetBlockClass · 0.70
SelfAttentionClass · 0.70
__init__Method · 0.45

Tested by

no test coverage detected