Method
__init__
(self, channels, use_conv, dims=2, out_channels=None, padding=1)
Source from the content-addressed store, hash-verified
| 97 | """ |
| 98 | |
| 99 | def __init__(self, channels, use_conv, dims=2, out_channels=None, padding=1): |
| 100 | super().__init__() |
| 101 | self.channels = channels |
| 102 | self.out_channels = out_channels or channels |
| 103 | self.use_conv = use_conv |
| 104 | self.dims = dims |
| 105 | if use_conv: |
| 106 | self.conv = conv_nd(dims, self.channels, self.out_channels, 3, padding=padding) |
| 107 | |
| 108 | def forward(self, x): |
| 109 | assert x.shape[1] == self.channels |
Tested by
no test coverage detected