docstr: Tests the Jacobian for random inputs.
docstr_tok: ["Tests","the","Jacobian","for","random","inputs","."]
code: def test_upsample_jacobian_random(self):
      """Tests the Jacobian for random inputs."""
      upsample = lambda image: pyramid.upsample(
          image, num_levels=_NUM_LEVELS
      )
      tensor_shape = np.random.randint(1, 5, size=4).tolist()
      image_random_init = np.random.uniform(size=tensor_shape)
  
      for level in range(_NUM_LEVELS):
          # We skip testing level = 0, which returns the image as is. In graph mode,
          # the gradient calculation fails when there are no nodes in the graph.
          if level == 0 and not tf.executing_eagerly():
              continue
          self.assert_jacobian_is_correct_fn(
              lambda x, level=level: upsample(x)[level],
              [image_random_init],
          )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from absl.testing import parameterized
  import numpy
  from six.moves import range
  import tensorflow
  from tensorflow_graphics.image import pyramid
  from tensorflow_graphics.util import test_case
label_desc: Use image node_id 7 for calling the PyramidTest obj's underlying member method code with example usage: obj.test_upsample_jacobian_random() without return types