def get_sdf_volume(self, conditional_volume, mask_volume, coords_volume, partial_origin):
        """

        :param conditional_volume: [1,C, dX,dY,dZ]
        :param mask_volume: [1,1, dX,dY,dZ]
        :param coords_volume: [1,3, dX,dY,dZ]
        :return:
        """
        device = conditional_volume.device
        chunk_size = 10240

        _, C, dX, dY, dZ = conditional_volume.shape
        conditional_volume = conditional_volume.view(C, dX * dY * dZ).permute(1, 0).contiguous()
        mask_volume = mask_volume.view(-1)
        coords_volume = coords_volume.view(3, dX * dY * dZ).permute(1, 0).contiguous()

        pts = coords_volume * self.voxel_size + partial_origin  # [dX*dY*dZ, 3]

        sdf_volume = torch.ones([dX * dY * dZ, 1]).float().to(device)

        conditional_volume = conditional_volume[mask_volume > 0]
        pts = pts[mask_volume > 0]
        conditional_volume = conditional_volume.split(chunk_size)
        pts = pts.split(chunk_size)

        sdf_all = []
        for pts_part, feature_part in zip(pts, conditional_volume):
            sdf_part = self.sdf_layer(pts_part, feature_part)[:, :1]
            sdf_all.append(sdf_part)

        sdf_all = torch.cat(sdf_all, dim=0)
        sdf_volume[mask_volume > 0] = sdf_all
        sdf_volume = sdf_volume.view(1, 1, dX, dY, dZ)
        return sdf_volume


        :param conditional_volume: [1,C, dX,dY,dZ]
        :param mask_volume: [1,1, dX,dY,dZ]
        :param coords_volume: [1,3, dX,dY,dZ]
        :return:
        
mv-diffusion/One-2-3-45-by-view/reconstruction/models/sparse_sdf_network.py