tfg.geometry.representation.mesh.sampler.generate_random_face_indices
Generate a sample of face ids given per face probability.
tfg.geometry.representation.mesh.sampler.generate_random_face_indices(
num_samples: int,
face_weights: type_alias.TensorLike,
seed: Optional[type_alias.TensorLike] = None,
stateless: bool = False,
name: str = 'generate_random_face_indices'
) -> type_alias.TensorLike
Note |
In the following, A1 to An are optional batch dimensions.
|
Args |
num_samples
|
An int32 scalar denoting the number of samples to generate
per mesh.
|
face_weights
|
A float tensor of shape [A1, ..., An, F] where F is
number of faces. All weights must be > 0.
|
seed
|
Optional seed for the random number generator.
|
stateless
|
Optional flag to use stateless random sampler. If stateless=True,
then seed must be provided as shape [2] int tensor. Stateless random
sampling is useful for testing to generate the same reproducible sequence
across calls. If stateless=False, then a stateful random number generator
is used (default behavior).
|
name
|
Name for op. Defaults to "generate_random_face_indices".
|
Returns |
An int32 tensor of shape [A1, ..., An, num_samples] denoting sampled
face indices.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2022-10-28 UTC.
[null,null,["Last updated 2022-10-28 UTC."],[],[]]