code: def th_nearest_interp3d(input_, coords):
      """
      2d nearest neighbor interpolation th.Tensor
      """
      # take clamp of coords so they're in the image bounds
      coords[:, 0] = th.clamp(
          coords[:, 0], 0, input_.size(1) - 1
      ).round()
      coords[:, 1] = th.clamp(
          coords[:, 1], 0, input_.size(2) - 1
      ).round()
      coords[:, 2] = th.clamp(
          coords[:, 2], 0, input_.size(3) - 1
      ).round()
  
      stride = th.LongTensor(input_.stride())[1:].float()
      idx = coords.mv(stride).long()
  
      input_flat = th_flatten(input_)
  
      mapped_vals = input_flat[idx]
  
      return mapped_vals.view_as(input_)
  
imports: import pickle
  import random
  from .optimizers import *
  from .callbacks import *
  import torch
  from pywick.callbacks import *
label_desc: Use image node_id 16 for calling a global function with example usage: th_nearest_interp3d(input_, coords) and returns: mapped_vals