From 539b48bd417f59acbe3adee6a4a1bef0aa5c5ad7 Mon Sep 17 00:00:00 2001 From: Bixia Zheng Date: Fri, 10 Aug 2018 09:25:38 -0700 Subject: [XLA] Enhance the HLO verifier to report errors for illegal Rng instructions. Modify ShapeVerifier::HandleRng to detect illegal Rng instructions. Add test cases to test the handling of Rng instructions in the HLO verifier. Modify the document for XLA random operations to reflect the supported data types. PiperOrigin-RevId: 208220062 --- .../performance/xla/operation_semantics.md | 24 ++++++++++++---------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'tensorflow/docs_src') diff --git a/tensorflow/docs_src/performance/xla/operation_semantics.md b/tensorflow/docs_src/performance/xla/operation_semantics.md index 02af71f8a3..fad9fd57f1 100644 --- a/tensorflow/docs_src/performance/xla/operation_semantics.md +++ b/tensorflow/docs_src/performance/xla/operation_semantics.md @@ -1877,19 +1877,19 @@ See also [`XlaBuilder::RngNormal`](https://www.tensorflow.org/code/tensorflow/compiler/xla/client/xla_builder.h). Constructs an output of a given shape with random numbers generated following -the $$N(\mu, \sigma)$$ normal distribution. The parameters `mu` and `sigma`, and -output shape have to have elemental type F32. The parameters furthermore have to -be scalar valued. +the $$N(\mu, \sigma)$$ normal distribution. The parameters $$\mu$$ and +$$\sigma$$, and output shape have to have a floating point elemental type. The +parameters furthermore have to be scalar valued. -`RngNormal(mean, sigma, shape)` +`RngNormal(mu, sigma, shape)` | Arguments | Type | Semantics | | --------- | ------- | --------------------------------------------------- | -| `mu` | `XlaOp` | Scalar of type F32 specifying mean of generated | -: : : numbers : -| `sigma` | `XlaOp` | Scalar of type F32 specifying standard deviation of | +| `mu` | `XlaOp` | Scalar of type T specifying mean of generated | +: : : numbers : +| `sigma` | `XlaOp` | Scalar of type T specifying standard deviation of | : : : generated numbers : -| `shape` | `Shape` | Output shape of type F32 | +| `shape` | `Shape` | Output shape of type T | ## RngUniform @@ -1898,9 +1898,11 @@ See also Constructs an output of a given shape with random numbers generated following the uniform distribution over the interval $$[a,b)$$. The parameters and output -shape may be either F32, S32 or U32, but the types have to be consistent. -Furthermore, the parameters need to be scalar valued. If $$b <= a$$ the result -is implementation-defined. +element type have to be a boolean type, an integral type or a floating point +types, and the types have to be consistent. The CPU and GPU backends currently +only support F64, F32, F16, BF16, S64, U64, S32 and U32. Furthermore, the +parameters need to be scalar valued. If $$b <= a$$ the result is +implementation-defined. `RngUniform(a, b, shape)` -- cgit v1.2.3