docstr: Test for provided face weights.
docstr_tok: ["Test","for","provided","face","weights","."]
code: def test_weighted_random_sample(self):
      """Test for provided face weights."""
      faces = np.array([[0, 1, 2], [2, 1, 3]], dtype=np.int32)
      vertex_attributes = np.array(
          [[0.0], [0.0], [1.0], [1.0]], dtype=np.float32
      )
  
      # Equal face weights, mean of sampled attributes = 0.5.
      expected_mean = np.array([0.5], dtype=np.float32)
      sample_pts, _ = sampler.weighted_random_sample_triangle_mesh(
          vertex_attributes,
          faces,
          num_samples=1000000,
          face_weights=(0.5, 0.5),
      )
      self.assertAllClose(
          expected_mean,
          tf.reduce_mean(input_tensor=sample_pts, axis=-2),
          atol=1e-3,
      )
      # Face weights biased towards second face, mean > 0.5
      sample_pts, _ = sampler.weighted_random_sample_triangle_mesh(
          vertex_attributes,
          faces,
          num_samples=1000000,
          face_weights=(0.2, 0.8),
      )
      self.assertGreater(
          tf.reduce_mean(input_tensor=sample_pts, axis=-2),
          expected_mean,
      )
  
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 13 for calling the MeshSamplerTest obj's underlying member method code with example usage: obj.test_weighted_random_sample() without return types