docstr: Test normalize methods.
docstr_tok: ["Test","normalize","methods","."]
code: def test_normalize(self):
      """Test normalize methods."""
      x = np.arange(256)
      y = objax.util.image.normalize_to_unit_float(x)
      self.assertEqual((x / 128 - (1 - 1 / 256)).tolist(), y.tolist())
      self.assertEqual(y.tolist(), y.clip(-1, 1).tolist())
      z = objax.util.image.normalize_to_uint8(y)
      self.assertEqual(x.tolist(), z.tolist())
      z = objax.util.image.normalize_to_uint8(y + 1 / 128)
      self.assertEqual((x + 1).clip(0, 255).tolist(), z.tolist())
      z = objax.util.image.normalize_to_uint8(y - 1 / 128)
      self.assertEqual((x - 1).clip(0, 255).tolist(), z.tolist())
  
file_path: objax/tests/util_image.py
imports: import io
  import tempfile
  import unittest
  from typing import Tuple
  import jax.numpy
  import numpy
  from PIL import Image
  import objax
label_desc: Use image node_id 4 for calling the TestUtilImage obj's underlying member method code with example usage: obj.test_normalize() without return types