def METHOD_NAME(self, x: Tensor, ref_kspace: Tensor, mask: Tensor) -> Tensor:
    """
    Applies data consistency to input x. Suppose x is an intermediate estimate of the kspace and ref_kspace
    is the reference under-sampled measurement. This function returns mask * (x - ref_kspace). View this as the
    residual between the original under-sampled kspace and the estimate given by the network.
    Args:
        x: 2D kspace (B,C,H,W,2) with the last dimension being 2 (for real/imaginary parts) and C denoting the
            coil dimension. 3D data will have the shape (B,C,H,W,D,2).
        ref_kspace: original under-sampled kspace with the same shape as x.
        mask: the under-sampling mask with shape (1,1,1,W,1) for 2D data or (1,1,1,1,D,1) for 3D data.
    Returns:
        Output of DC block with the same shape as x
    """
    return torch.where(mask, x - ref_kspace, self.zeros) * self.dc_weight  # type: ignore