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",")"]
code: def __init__(
      self,
      num_steps: int = 7,
      mode=GridSampleMode.BILINEAR.value,
      padding_mode=GridSamplePadMode.ZEROS.value,
  ):
      super().__init__()
      if num_steps <= 0:
          raise ValueError(
              f"expecting positive num_steps, got {num_steps}"
          )
      self.num_steps = num_steps
      self.warp_layer = Warp(mode=mode, padding_mode=padding_mode)
  
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 1 to create a new DVF2DDF object from inherited base classes: nn with example: obj = DVF2DDF(num_steps, mode, padding_mode)