docstr: Tests whether interpolation results are correct.
docstr_tok: ["Tests","whether","interpolation","results","are","correct","."]
code: def test_interpolation_preset(self):
      """Tests whether interpolation results are correct."""
      batch_dim_size = np.random.randint(0, 4)
      batch_dims = list(np.random.randint(1, 10, size=batch_dim_size))
      cube_single_dim = np.random.randint(3, 10)
      cube_dims = [cube_single_dim, cube_single_dim, cube_single_dim]
      num_channels = [np.random.randint(1, 10)]
      combined_dims = batch_dims + cube_dims + num_channels
      voxels_in = _generate_voxel_cube(combined_dims, "horizontal")
      euler_angles = np.zeros(batch_dims + [3])
      euler_angles[..., 2] = np.pi / 2.0
      voxels_out = _generate_voxel_cube(combined_dims, "vertical")
  
      transformation_matrix = rotation_matrix_3d.from_euler(
          euler_angles
      )
      grid_size = (cube_single_dim, cube_single_dim, cube_single_dim)
      sampling_points = _sampling_points_from_grid(grid_size)
      sampling_points = tf.matmul(
          transformation_matrix, tf.transpose(a=sampling_points)
      )
      sampling_points = _transpose_last_two_dims(sampling_points)
      sampling_points = _sampling_points_in_volume(
          sampling_points, voxels_in.shape[-4:-1]
      )
      voxels_out = tf.reshape(
          voxels_out, batch_dims + [cube_single_dim**3] + num_channels
      )
  
      self.assert_output_is_correct(
          trilinear.interpolate,
          (voxels_in, sampling_points),
          (voxels_out,),
          tile=False,
      )
  
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.geometry.representation import grid
  from tensorflow_graphics.geometry.transformation import rotation_matrix_3d
  from tensorflow_graphics.math.interpolation import trilinear
  from tensorflow_graphics.util import test_case
label_desc: Use image node_id 4 for calling the TrilinearTest obj's underlying member method code with example usage: obj.test_interpolation_preset() without return types