def forward(self, scale0: int, scale1: int, scale2: int) -> tuple[torch.Tensor, torch.Tensor, torch.Tensor]:
        """Apply cross-scale convolutions to input features.

        Processes features at three scales with cross-connections between scales via
        up/downsampling operations. This implements the architecture shown in Figure 4
        of the CS-Flow paper.

        Args:
            scale0 (torch.Tensor): Features at original scale.
            scale1 (torch.Tensor): Features at 1/2 scale.
            scale2 (torch.Tensor): Features at 1/4 scale.

        Returns:
            tuple[torch.Tensor, torch.Tensor, torch.Tensor]: Processed features at three
                scales. Each tensor contains scale and transform parameters concatenated
                along the channel dimension.
        """
        # Increase the number of channels to hidden channel length via convolutions and apply leaky ReLU.
        out0 = self.conv_scale0_0(scale0)
        out1 = self.conv_scale1_0(scale1)
        out2 = self.conv_scale2_0(scale2)

        lr0 = self.leaky_relu(out0)
        lr1 = self.leaky_relu(out1)
        lr3 = self.leaky_relu(out2)

        # Decrease the number of channels to scale and transform split length.
        out0 = self.conv_scale0_1(lr0)
        out1 = self.conv_scale1_1(lr1)
        out2 = self.conv_scale2_1(lr3)

        # Upsample the smaller scales.
        y1_up = self.up_conv10(self.upsample(lr1))
        y2_up = self.up_conv21(self.upsample(lr3))

        # Downsample the larger scales.
        y0_down = self.down_conv01(lr0)
        y1_down = self.down_conv12(lr1)

        # Do element-wise sum on cross-scale outputs.
        out0 = out0 + y1_up
        out1 = out1 + y0_down + y2_up
        out2 = out2 + y1_down

        if self.use_gamma:
            out0 = out0 * self.gamma0
            out1 = out1 * self.gamma1
            out2 = out2 * self.gamma2
        # even channel split is performed outside this block
        return out0, out1, out2
Apply cross-scale convolutions to input features.

        Processes features at three scales with cross-connections between scales via
        up/downsampling operations. This implements the architecture shown in Figure 4
        of the CS-Flow paper.

        Args:
            scale0 (torch.Tensor): Features at original scale.
            scale1 (torch.Tensor): Features at 1/2 scale.
            scale2 (torch.Tensor): Features at 1/4 scale.

        Returns:
            tuple[torch.Tensor, torch.Tensor, torch.Tensor]: Processed features at three
                scales. Each tensor contains scale and transform parameters concatenated
                along the channel dimension.
        
src/anomalib/models/image/csflow/torch_model.py