MCPcopy Create free account
hub / github.com/Royalvice/DocDiff / DownBlock

Class DownBlock

model/DocDiff.py:119–131  ·  view source on GitHub ↗

### Down block This combines `ResidualBlock` and `AttentionBlock`. These are used in the first half of U-Net at each resolution.

Source from the content-addressed store, hash-verified

117
118
119class DownBlock(nn.Module):
120 """
121 ### Down block
122 This combines `ResidualBlock` and `AttentionBlock`. These are used in the first half of U-Net at each resolution.
123 """
124
125 def __init__(self, in_channels: int, out_channels: int, time_channels: int, is_noise: bool = True):
126 super().__init__()
127 self.res = ResidualBlock(in_channels, out_channels, time_channels, is_noise=is_noise)
128
129 def forward(self, x: torch.Tensor, t: torch.Tensor):
130 x = self.res(x, t)
131 return x
132
133
134class UpBlock(nn.Module):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected