docstr: Checks that energy evaluated between the rest pose and itself is zero.
docstr_tok: ["Checks","that","energy","evaluated","between","the","rest","pose","and","itself","is","zero","."]
code: def test_energy_identity(self):
      """Checks that energy evaluated between the rest pose and itself is zero."""
      number_vertices = np.random.randint(3, 10)
      batch_size = np.random.randint(3)
      batch_shape = np.random.randint(1, 10, size=(batch_size)).tolist()
      vertices_rest_pose = np.random.uniform(size=(number_vertices, 3))
      vertices_deformed_pose = tf.broadcast_to(
          vertices_rest_pose, shape=batch_shape + [number_vertices, 3]
      )
      quaternions = quaternion.from_euler(
          np.zeros(shape=batch_shape + [number_vertices, 3])
      )
      num_edges = int(round(number_vertices / 2))
      edges = np.zeros(shape=(num_edges, 2), dtype=np.int32)
      edges[..., 0] = np.linspace(
          0, number_vertices / 2 - 1, num_edges, dtype=np.int32
      )
      edges[..., 1] = np.linspace(
          number_vertices / 2,
          number_vertices - 1,
          num_edges,
          dtype=np.int32,
      )
  
      energy = as_conformal_as_possible.energy(
          vertices_rest_pose=vertices_rest_pose,
          vertices_deformed_pose=vertices_deformed_pose,
          quaternions=quaternions,
          edges=edges,
          conformal_energy=False,
      )
  
      self.assertAllClose(energy, tf.zeros_like(energy))
  
file_path: graphics/tensorflow_graphics/geometry/deformation_energy/tests/as_conformal_as_possible_test.py
imports: from absl.testing import flagsaver
  from absl.testing import parameterized
  import numpy
  import tensorflow
  from tensorflow_graphics.geometry.deformation_energy import as_conformal_as_possible
  from tensorflow_graphics.geometry.transformation import quaternion
  from tensorflow_graphics.util import test_case
label_desc: Use image node_id 1 for calling the AsConformalAsPossibleTest obj's underlying member method code with example usage: obj.test_energy_identity() without return types