class_docstr: Unit test RandomResize.
class_docstr_tok: ["Unit","test","RandomResize","."]
docstr: Test consistency between Resize and RandomResize.
docstr_tok: ["Test","consistency","between","Resize","and","RandomResize","."]
code: def test_resize_randomresize(self):
      """Test consistency between Resize and RandomResize."""
      features = fake_decoded_features(7, 5, 4)
      transform_resize = transforms.Resize(10, max_size=11)
      transform_rnd_resize = transforms.RandomResize(
          [
              10,
          ],
          max_size=11,
      )
  
      # resizes features using two different `Transforms` that are mathematically
      # identical
      features_resized = transform_resize(copy.deepcopy(features))
      features_rnd_resized = transform_rnd_resize(
          copy.deepcopy(features)
      )
  
      # asserts that the outputs match
      self._assert_features_equal(
          features_resized,
          features_rnd_resized,
          msg="resized vs random resized",
      )
  
      # checks that they do not match had the parameter been different
      transform_rnd_resize = transforms.RandomResize(
          [
              10,
          ],
          max_size=None,
      )
      features_rnd_resized = transform_rnd_resize(
          copy.deepcopy(features)
      )
      with self.assertRaises(AssertionError):
          self._assert_features_equal(
              features_resized,
              features_rnd_resized,
              msg="resized vs random resized",
          )
  
imports: import copy
  from absl.testing import absltest
  from absl.testing import parameterized
  import numpy
  from scenic.projects.baselines.detr import transforms
  import tensorflow
label_desc: Use image node_id 3 for calling the RandomResizeTest obj's underlying member method code with example usage: obj.test_resize_randomresize() without return types