code: def _resize_image_onnx(image, self_min_size, self_max_size):
      # type: (Tensor, float, float) -> Tensor
      from torch.onnx import operators
  
      im_shape = operators.shape_as_tensor(image)[-2:]
      min_size = torch.min(im_shape).to(dtype=torch.float32)
      max_size = torch.max(im_shape).to(dtype=torch.float32)
      scale_factor = torch.min(
          self_min_size / min_size, self_max_size / max_size
      )
  
      image = torch.nn.functional.interpolate(
          image[None],
          scale_factor=scale_factor,
          mode="bilinear",
          recompute_scale_factor=True,
          align_corners=False,
      )[0]
  
      return image
  
imports: import math
  from typing import List, Tuple, Dict, Optional
  import torch
  from torch import nn, Tensor
  import torchvision
  from .image_list import ImageList
label_desc: Use image node_id 1 for calling a global function with example usage: _resize_image_onnx(image, _min_size, _max_size) and returns: image