class_docstr: A variational block based on Sriram et. al., "End-to-end variational networks for accelerated MRI reconstruction".
  It applies data consistency and refinement to the intermediate kspace and combines those results.
  
  Modified and adopted from: https://github.com/facebookresearch/fastMRI
  
  Args:
      refinement_model: the model used for refinement (typically a U-Net but can be any deep learning model
          that performs well when the input and output are in image domain (e.g., a convolutional network).
      spatial_dims: is 2 for 2D data and is 3 for 3D data
docstr: Args:
      current_kspace: Predicted kspace from the previous block. It's a 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: reference kspace for applying data consistency (is the under-sampled kspace in MRI reconstruction).
          Its shape is the same as current_kspace.
      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.
      sens_maps: coil sensitivity maps with the same shape as current_kspace
  
  Returns:
      Output of VarNetBlock with the same shape as current_kspace
docstr_tok: ["Args",":","current_kspace",":","Predicted","kspace","from","the","previous","block",".","It","'s","a","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",":","reference","kspace","for","applying","data","consistency","(","is","the","under-sampled","kspace","in","MRI","reconstruction",")",".","Its","shape","is","the","same","as","current_kspace",".","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",".","sens_maps",":","coil","sensitivity","maps","with","the","same","shape","as","current_kspace","Returns",":","Output","of","VarNetBlock","with","the","same","shape","as","current_kspace"]
code: def forward(
      self,
      current_kspace: Tensor,
      ref_kspace: Tensor,
      mask: Tensor,
      sens_maps: Tensor,
  ) -> Tensor:
      """
      Args:
          current_kspace: Predicted kspace from the previous block. It's a 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: reference kspace for applying data consistency (is the under-sampled kspace in MRI reconstruction).
              Its shape is the same as current_kspace.
          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.
          sens_maps: coil sensitivity maps with the same shape as current_kspace
  
      Returns:
          Output of VarNetBlock with the same shape as current_kspace
      """
      dc_out = self.soft_dc(
          current_kspace, ref_kspace, mask
      )  # output of DC block
      refinement_out = sensitivity_map_expand(
          self.model(
              sensitivity_map_reduce(
                  current_kspace,
                  sens_maps,
                  spatial_dims=self.spatial_dims,
              )
          ),
          sens_maps,
          spatial_dims=self.spatial_dims,
      )  # output of refinement model
      output = current_kspace - dc_out - refinement_out
      return output
  
file_path: MONAI/monai/apps/reconstruction/networks/blocks/varnetblock.py
imports: from __future__ import annotations
  import torch
  import torch.nn
  from torch import Tensor
  from monai.apps.reconstruction.networks.nets.utils import sensitivity_map_expand, sensitivity_map_reduce
label_desc: Use image node_id 3 for calling the VarNetBlock obj's underlying member method code with example usage: obj.forward(current_kspace, ref_kspace, mask, sens_maps) and returns: output