yobx.tensorflow.ops.random_ops#

Converters for TF random-sampling ops.

Random normal#

RandomStandardNormal

yobx.tensorflow.ops.random_ops.convert_random_standard_normal(g: GraphBuilderExtendedProtocol, sts: Dict[str, Any], outputs: List[str], op: Operation) str[source]#

Converts TF RandomStandardNormal → ONNX ConstantOfShape + RandomNormalLike.

TF RandomStandardNormal draws samples from a standard normal distribution given a dynamic shape tensor. ONNX does not have an op that accepts a dynamic shape for random generation, but RandomNormalLike generates standard-normal values that match the shape and dtype of its input tensor. A zero-filled ConstantOfShape is therefore first created with the requested shape, and then RandomNormalLike is applied to it.

The output dtype is taken from the TF op’s dtype attribute. The output shape is inferred from the TF op’s output shape metadata (which always contains the correct rank even when individual dimensions are unknown) and recorded in the graph builder so that downstream shape assertions are satisfied.