code: def test_interpolate(self):
      x = shaparange((1, 3, 2, 3, 10, 30))
      shape = x.shape
      for method in self.methods:
          output = 2
          y = objax.functional.core.ops.interpolate(
              x, scale_factor=output, mode=method
          )
          self.assertEqual(
              y.shape, (shape[0], *(jn.array(shape[1:])) * output)
          )
          output = (2, 2, 2)
          y = objax.functional.core.ops.interpolate(
              x, scale_factor=output, mode=method
          )
          self.assertEqual(
              y.shape,
              (
                  *shape[: len(shape) - len(output)],
                  *(
                      jn.array(shape[len(shape) - len(output) :])
                      * jn.array(output)
                  ),
              ),
          )
          output = (2, 2, 2, 2)
          y = objax.functional.core.ops.interpolate(
              x, scale_factor=output, mode=method
          )
          self.assertEqual(
              y.shape,
              (
                  *shape[: len(shape) - len(output)],
                  *(
                      jn.array(shape[len(shape) - len(output) :])
                      * jn.array(output)
                  ),
              ),
          )
          output = 2
          y = objax.functional.core.ops.interpolate(
              x, size=output, mode=method
          )
          self.assertEqual(y.shape, (*shape[:-1], output))
          output = (2, 2, 2)
          y = objax.functional.core.ops.interpolate(
              x, size=output, mode=method
          )
          self.assertEqual(
              y.shape, (*shape[: len(shape) - len(output)], *output)
          )
          output = (2, 2, 2, 2)
          y = objax.functional.core.ops.interpolate(
              x, size=output, mode=method
          )
          self.assertEqual(
              y.shape, (*shape[: len(shape) - len(output)], *output)
          )
  
file_path: objax/tests/functional_interpolate.py
imports: import unittest
  import jax
  import jax.numpy
  import numpy
  import objax
label_desc: Use image node_id 2 for calling the TestUpsample obj's underlying member method code with example usage: obj.test_interpolate() without return types