def forward(self, img_pred, img_gt):
        """
        :param img_pred: [Npx, nviews, npatch, c]
        :param img_gt: [Npx, npatch, c]
        :return:
        """
        ntotpx, nviews, npatch, channels = img_pred.shape

        patch_size = int(sqrt(npatch))
        patch_img_pred = img_pred.reshape(ntotpx, nviews, patch_size, patch_size, channels).permute(0, 1, 4, 2,
                                                                                                    3).contiguous()
        patch_img_gt = img_gt.reshape(ntotpx, patch_size, patch_size, channels).permute(0, 3, 1, 2)

        return _ncc(patch_img_pred, patch_img_gt, self.window, self.channel)

        :param img_pred: [Npx, nviews, npatch, c]
        :param img_gt: [Npx, npatch, c]
        :return:
        
mv-diffusion/One-2-3-45-by-view/reconstruction/loss/ncc.py