* Creates a `tf.Tensor` with values sampled from a normal distribution. * * The generated values will have mean 0 and standard deviation 1. * * ```js * tf.randomStandardNormal([2, 2]).print(); * ``` * * @param shape An array of integers defining the output tensor shape. * @param dtype The d
(
shape: ShapeMap[R], dtype?: 'float32'|'int32', seed?: number)
| 37 | * @doc {heading: 'Tensors', subheading: 'Random'} |
| 38 | */ |
| 39 | function randomStandardNormal_<R extends Rank>( |
| 40 | shape: ShapeMap[R], dtype?: 'float32'|'int32', seed?: number): Tensor<R> { |
| 41 | if (dtype != null && (dtype as DataType) === 'bool') { |
| 42 | throw new Error(`Unsupported data type ${dtype}`); |
| 43 | } |
| 44 | return randomNormal(shape, 0, 1, dtype, seed); |
| 45 | } |
| 46 | |
| 47 | export const randomStandardNormal = /* @__PURE__ */ op({randomStandardNormal_}); |
nothing calls this directly
no test coverage detected
searching dependent graphs…