code: def test_resize():
      output_size = (32, 32)
      transfo = T.Resize(output_size)
      input_t = tf.cast(tf.fill([64, 64, 3], 1), dtype=tf.float32)
      out = transfo(input_t)
  
      assert tf.math.reduce_all(tf.math.abs(out - 1) < 1e-6)
      assert out.shape[:2] == output_size
      assert (
          repr(transfo)
          == f"Resize(output_size={output_size}, method='bilinear')"
      )
  
      transfo = T.Resize(output_size, preserve_aspect_ratio=True)
      input_t = tf.cast(tf.fill([32, 64, 3], 1), dtype=tf.float32)
      out = transfo(input_t)
  
      assert not tf.reduce_all(out == 1)
      # Asymetric padding
      assert tf.reduce_all(out[-1] == 0) and tf.math.reduce_all(
          tf.math.abs(out[0] - 1) < 1e-6
      )
      assert out.shape[:2] == output_size
  
      # Symetric padding
      transfo = T.Resize(
          output_size, preserve_aspect_ratio=True, symmetric_pad=True
      )
      assert repr(transfo) == (
          f"Resize(output_size={output_size}, method='bilinear', "
          f"preserve_aspect_ratio=True, symmetric_pad=True)"
      )
      out = transfo(input_t)
      # Asymetric padding
      assert tf.reduce_all(out[-1] == 0) and tf.reduce_all(out[0] == 0)
  
      # Inverse aspect ratio
      input_t = tf.cast(tf.fill([64, 32, 3], 1), dtype=tf.float32)
      out = transfo(input_t)
  
      assert not tf.reduce_all(out == 1)
      assert out.shape[:2] == output_size
  
      # FP16
      input_t = tf.cast(tf.fill([64, 64, 3], 1), dtype=tf.float16)
      out = transfo(input_t)
      assert out.dtype == tf.float16
  
imports: import math
  import numpy
  import pytest
  import tensorflow
  from doctr import transforms
  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