MCPcopy Create free account
hub / github.com/VisionXLab/OF-Diff / __init__

Method __init__

cldm/fet.py:15–24  ·  view source on GitHub ↗
(self, dims, in_channels, out_channels)

Source from the content-addressed store, hash-verified

13
14class ResidualBlock(nn.Module):
15 def __init__(self, dims, in_channels, out_channels):
16 super(ResidualBlock, self).__init__()
17 self.conv1 = conv_nd(dims, in_channels, out_channels, kernel_size=3, stride=1, padding=1)
18 self.silu = nn.SiLU()
19 self.conv2 = conv_nd(dims, out_channels, out_channels, kernel_size=3, stride=1, padding=1)
20
21 if in_channels != out_channels:
22 self.residual = conv_nd(dims, in_channels, out_channels, kernel_size=1, stride=1)
23 else:
24 self.residual = nn.Identity()
25
26 def forward(self, x):
27 residual = self.residual(x)

Callers

nothing calls this directly

Calls 2

conv_ndFunction · 0.90
__init__Method · 0.45

Tested by

no test coverage detected