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→ ONNXConstantOfShape+RandomNormalLike.TF
RandomStandardNormaldraws 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, butRandomNormalLikegenerates standard-normal values that match the shape and dtype of its input tensor. A zero-filledConstantOfShapeis therefore first created with the requested shape, and thenRandomNormalLikeis applied to it.The output dtype is taken from the TF op’s
dtypeattribute. 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.