code: def test_resize():
      output_size = (32, 32)
      transfo = Resize(output_size)
      input_t = torch.ones((3, 64, 64), dtype=torch.float32)
      out = transfo(input_t)
  
      assert torch.all(out == 1)
      assert out.shape[-2:] == output_size
      assert (
          repr(transfo)
          == f"Resize(output_size={output_size}, interpolation='bilinear')"
      )
  
      transfo = Resize(output_size, preserve_aspect_ratio=True)
      input_t = torch.ones((3, 32, 64), dtype=torch.float32)
      out = transfo(input_t)
  
      assert out.shape[-2:] == output_size
      assert not torch.all(out == 1)
      # Asymetric padding
      assert torch.all(out[:, -1] == 0) and torch.all(out[:, 0] == 1)
  
      # Symetric padding
      transfo = Resize(
          output_size, preserve_aspect_ratio=True, symmetric_pad=True
      )
      assert repr(transfo) == (
          f"Resize(output_size={output_size}, interpolation='bilinear', "
          f"preserve_aspect_ratio=True, symmetric_pad=True)"
      )
      out = transfo(input_t)
      assert out.shape[-2:] == output_size
      # symetric padding
      assert torch.all(out[:, -1] == 0) and torch.all(out[:, 0] == 0)
  
      # Inverse aspect ratio
      input_t = torch.ones((3, 64, 32), dtype=torch.float32)
      out = transfo(input_t)
  
      assert not torch.all(out == 1)
      assert out.shape[-2:] == output_size
  
      # Same aspect ratio
      output_size = (32, 128)
      transfo = Resize(output_size, preserve_aspect_ratio=True)
      out = transfo(torch.ones((3, 16, 64), dtype=torch.float32))
      assert out.shape[-2:] == output_size
  
      # FP16
      input_t = torch.ones((3, 64, 64), dtype=torch.float16)
      out = transfo(input_t)
      assert out.dtype == torch.float16
  
file_path: doctr/tests/pytorch/test_transforms_pt.py
imports: import math
  import numpy
  import pytest
  import torch
  from doctr.transforms import ChannelShuffle, ColorInversion, GaussianNoise, RandomCrop, RandomHorizontalFlip, RandomRotate, RandomShadow, Resize
  from doctr.transforms.functional import crop_detection, rotate_sample
label_desc: Use image node_id 1 for calling a global function with example usage: test_resize() without return types