class_docstr: Layer calculates a dense displacement field (DDF) from a dense velocity field (DVF)
  with scaling and squaring.
  
  Adapted from:
      DeepReg (https://github.com/DeepRegNet/DeepReg)
class_docstr_tok: ["Layer","calculates","a","dense","displacement","field","(","DDF",")","from","a","dense","velocity","field","(","DVF",")","with","scaling","and","squaring",".","Adapted","from",":","DeepReg","(","https",":","\/\/github.com\/DeepRegNet\/DeepReg",")"]
docstr: Args:
      dvf: dvf to be transformed, in shape (batch, ``spatial_dims``, H, W[,D])
  
  Returns:
      a dense displacement field
docstr_tok: ["Args",":","dvf",":","dvf","to","be","transformed",",","in","shape","(","batch",",","``","spatial_dims","``",",","H",",","W","[",",","D","]",")","Returns",":","a","dense","displacement","field"]
code: def forward(self, dvf: torch.Tensor) -> torch.Tensor:
      """
      Args:
          dvf: dvf to be transformed, in shape (batch, ``spatial_dims``, H, W[,D])
  
      Returns:
          a dense displacement field
      """
      ddf: torch.Tensor = dvf / (2**self.num_steps)
      for _ in range(self.num_steps):
          ddf = ddf + self.warp_layer(image=ddf, ddf=ddf)
      return ddf
  
file_path: MONAI/monai/networks/blocks/warp.py
imports: from __future__ import annotations
  import warnings
  import torch
  from torch import nn
  from torch.nn import functional
  from monai.config.deviceconfig import USE_COMPILED
  from monai.networks.layers.spatial_transforms import grid_pull
  from monai.networks.utils import meshgrid_ij
  from monai.utils import GridSampleMode, GridSamplePadMode, optional_import
label_desc: Use image node_id 2 for calling the DVF2DDF obj's underlying member method code with example usage: obj.forward(dvf) and returns: ddf