| 42 | |
| 43 | |
| 44 | class TGrow(nn.Module): |
| 45 | def __init__(self, n_f, stride): |
| 46 | super().__init__() |
| 47 | self.stride = stride |
| 48 | self.conv = nn.Conv2d(n_f, n_f * stride, 1, bias=False) |
| 49 | |
| 50 | def forward(self, x): |
| 51 | _NT, C, H, W = x.shape |
| 52 | x = self.conv(x) |
| 53 | return x.reshape(-1, C, H, W) |
| 54 | |
| 55 | |
| 56 | def apply_model_with_memblocks(model, x, parallel, show_progress_bar): |