code: def elastic_transform(
      img: Tensor,
      displacement: Tensor,
      interpolation: str = "bilinear",
      fill: Optional[Union[int, float, List[float]]] = None,
  ) -> Tensor:
      if not (isinstance(img, torch.Tensor)):
          raise TypeError(f"img should be Tensor. Got {type(img)}")
  
      size = list(img.shape[-2:])
      displacement = displacement.to(img.device)
  
      identity_grid = _create_identity_grid(size)
      grid = identity_grid.to(img.device) + displacement
      return _apply_grid_transform(img, grid, interpolation, fill)
  
imports: import warnings
  from typing import List, Optional, Tuple, Union
  import torch
  from torch import Tensor
  from torch.nn.functional import conv2d, grid_sample, interpolate, pad
label_desc: Use image node_id 50 for calling a global function with example usage: elastic_transform(img, displacement, interpolation, fill) and returns: _apply_grid_transform