(self, channels, use_conv, dims=2, out_channels=None,padding=1)
| 140 | """ |
| 141 | |
| 142 | def __init__(self, channels, use_conv, dims=2, out_channels=None,padding=1): |
| 143 | super().__init__() |
| 144 | self.channels = channels |
| 145 | self.out_channels = out_channels or channels |
| 146 | self.use_conv = use_conv |
| 147 | self.dims = dims |
| 148 | stride = 2 if dims != 3 else (1, 2, 2) |
| 149 | if use_conv: |
| 150 | self.op = conv_nd( |
| 151 | dims, self.channels, self.out_channels, 3, stride=stride, padding=padding |
| 152 | ) |
| 153 | else: |
| 154 | assert self.channels == self.out_channels |
| 155 | self.op = avg_pool_nd(dims, kernel_size=stride, stride=stride) |
| 156 | |
| 157 | def forward(self, x): |
| 158 | assert x.shape[1] == self.channels |
nothing calls this directly
no test coverage detected