docstr: Test for area weighted sampler distribution.
docstr_tok: ["Test","for","area","weighted","sampler","distribution","."]
code: def test_area_sampler_distribution(self):
      """Test for area weighted sampler distribution."""
      vertices, faces = mesh_test_utils.create_single_triangle_mesh()
      vertices = np.repeat(np.expand_dims(vertices, axis=0), 3, axis=0)
      faces = np.repeat(np.expand_dims(faces, axis=0), 3, axis=0)
      num_samples = 5000
      sample_pts, _ = sampler.area_weighted_random_sample_triangle_mesh(
          vertices, faces, num_samples
      )
  
      for i in range(3):
          samples = sample_pts[i, ...]
          self.assertEqual(samples.shape[-2], num_samples)
          # Test distribution in 4 quadrants of [0,1]x[0,1]
          v = samples[:, :2] < [0.5, 0.5]
          not_v = tf.logical_not(v)
          quad00 = tf.math.count_nonzero(
              tf.reduce_all(input_tensor=v, axis=-1)
          )
          quad11 = tf.math.count_nonzero(
              tf.reduce_all(input_tensor=not_v, axis=-1)
          )
          quad01 = tf.math.count_nonzero(
              tf.reduce_all(
                  input_tensor=tf.stack((v[:, 0], not_v[:, 1]), axis=1),
                  axis=-1,
              )
          )
          quad10 = tf.math.count_nonzero(
              tf.reduce_all(
                  input_tensor=tf.stack((not_v[:, 0], v[:, 1]), axis=1),
                  axis=-1,
              )
          )
          counts = tf.stack((quad00, quad01, quad10, quad11), axis=0)
          expected = np.array(
              [num_samples / 2, num_samples / 4, num_samples / 4, 0],
              dtype=np.float32,
          )
          self.compare_poisson_equivalence(expected, counts)
  
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.mesh import sampler
  from tensorflow_graphics.geometry.representation.mesh.tests import mesh_test_utils
  from tensorflow_graphics.util import test_case
label_desc: Use image node_id 17 for calling the MeshSamplerTest obj's underlying member method code with example usage: obj.test_area_sampler_distribution() without return types