(self,
input_filters,
num_filters,
down_sampling_stride,
down_sampling=False
)
| 675 | |
| 676 | class Res3DBlockUpsample(nn.Module): |
| 677 | def __init__(self, |
| 678 | input_filters, |
| 679 | num_filters, |
| 680 | down_sampling_stride, |
| 681 | down_sampling=False |
| 682 | ): |
| 683 | super().__init__() |
| 684 | |
| 685 | self.input_filters = input_filters |
| 686 | self.num_filters = num_filters |
| 687 | |
| 688 | self.act_ = nn.SiLU(inplace=True) |
| 689 | |
| 690 | self.conv1 = CausalConvChannelLast(num_filters, num_filters, kernel_size=[3, 3, 3]) |
| 691 | self.norm1 = BaseGroupNorm(32, num_filters) |
| 692 | |
| 693 | self.conv2 = CausalConvChannelLast(num_filters, num_filters, kernel_size=[3, 3, 3]) |
| 694 | self.norm2 = BaseGroupNorm(32, num_filters) |
| 695 | |
| 696 | self.down_sampling = down_sampling |
| 697 | if down_sampling: |
| 698 | self.down_sampling_stride = down_sampling_stride |
| 699 | else: |
| 700 | self.down_sampling_stride = [1, 1, 1] |
| 701 | |
| 702 | if num_filters != input_filters or down_sampling: |
| 703 | self.conv3 = CausalConvChannelLast(input_filters, num_filters, kernel_size=[1, 1, 1], stride=self.down_sampling_stride) |
| 704 | self.norm3 = BaseGroupNorm(32, num_filters) |
| 705 | |
| 706 | def forward(self, x, is_init=False): |
| 707 | x = x.permute(0,2,3,4,1).contiguous() |
nothing calls this directly
no test coverage detected