code: def to_numpy(
      float_tensor: torch.Tensor,
      target_shape: list,
      target_dtype: np.dtype,
  ) -> np.ndarray:
      """
      Convert float tensor with dimension of NxCxHxW back to numpy array.
      Args:
          float_tensor (tensor): a float pytorch tensor with shape of NxCxHxW.
          target_shape (list): the target shape of the numpy array to represent
              the image as output. options include NxHxWxC, or HxWxC or HxW.
          target_dtype (dtype): the target dtype of the numpy array to represent
              the image as output. The array can be of type uint8 in range
              [0, 255], or floating point in range [0, 1] or [0, 255].
      Returns:
          (ndarray): converted numpy array.
      """
      assert len(target_shape) in (2, 3, 4)
  
      if len(target_shape) == 2:
          # 1x1xHxW -> HxW.
          assert float_tensor.shape[0] == 1
          assert float_tensor.shape[1] == 1
          float_tensor = float_tensor[0, 0, :, :]
      elif len(target_shape) == 3:
          assert float_tensor.shape[0] == 1
          # 1xCxHxW -> HxWxC.
          float_tensor = float_tensor[0].permute(1, 2, 0)
      elif len(target_shape) == 4:
          # NxCxHxW -> NxHxWxC
          float_tensor = float_tensor.permute(0, 2, 3, 1)
      else:
          raise NotImplementedError(
              "Unknow target shape dimension of {}".format(target_shape)
          )
      if target_dtype == np.uint8:
          # Need to specifically call round here, notice in pytroch the round
          # is half to even.
          # https://github.com/pytorch/pytorch/issues/16498
          float_tensor = float_tensor.round().byte()
      return float_tensor.numpy()
  
label_desc: Use image node_id 2 for calling a global function with example usage: to_numpy(float_tensor, target_shape, target_dtype) and returns: float_tensor