docstr: Tests the outputs of test_rotate_zonal_harmonics.
docstr_tok: ["Tests","the","outputs","of","test_rotate_zonal_harmonics","."]
code: def test_rotate_zonal_harmonics_random(self):
      """Tests the outputs of test_rotate_zonal_harmonics."""
      dtype = tf.float64
      max_band = 2
      zonal_coeffs = tf.constant(
          np.random.uniform(-1.0, 1.0, size=[3]), dtype=dtype
      )
      tensor_size = np.random.randint(3)
      tensor_shape = np.random.randint(
          1, 10, size=(tensor_size)
      ).tolist()
      theta = tf.constant(
          np.random.uniform(0.0, np.pi, size=tensor_shape + [1]),
          dtype=dtype,
      )
      phi = tf.constant(
          np.random.uniform(0.0, 2.0 * np.pi, size=tensor_shape + [1]),
          dtype=dtype,
      )
  
      rotated_zonal_coeffs = spherical_harmonics.rotate_zonal_harmonics(
          zonal_coeffs, theta, phi
      )
      zonal_coeffs = spherical_harmonics.tile_zonal_coefficients(
          zonal_coeffs
      )
      l, m = spherical_harmonics.generate_l_m_permutations(max_band)
      l = tf.broadcast_to(l, tensor_shape + l.shape.as_list())
      m = tf.broadcast_to(m, tensor_shape + m.shape.as_list())
      theta_zero = tf.constant(
          0.0, shape=tensor_shape + [1], dtype=dtype
      )
      phi_zero = tf.constant(0.0, shape=tensor_shape + [1], dtype=dtype)
      gt = (
          zonal_coeffs
          * spherical_harmonics.evaluate_spherical_harmonics(
              l, m, theta_zero, phi_zero
          )
      )
      gt = tf.reduce_sum(input_tensor=gt, axis=-1)
      pred = (
          rotated_zonal_coeffs
          * spherical_harmonics.evaluate_spherical_harmonics(
              l, m, theta + theta_zero, phi + phi_zero
          )
      )
      pred = tf.reduce_sum(input_tensor=pred, axis=-1)
  
      self.assertAllClose(gt, pred)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import sys
  from absl.testing import parameterized
  import numpy
  import tensorflow
  from tensorflow_graphics.math import math_helpers
  from tensorflow_graphics.math import spherical_harmonics
  from tensorflow_graphics.util import asserts
  from tensorflow_graphics.util import test_case
label_desc: Use image node_id 23 for calling the SphericalHarmonicsTest obj's underlying member method code with example usage: obj.test_rotate_zonal_harmonics_random() without return types