(
shape: Shape, mean = 0.0, stddev = 1.0, dtype?: DataType, seed?: number,
name = 'truncatedNormal')
| 250 | * @return The truncated-normal-random Variable. |
| 251 | */ |
| 252 | export function truncatedNormalVariable( |
| 253 | shape: Shape, mean = 0.0, stddev = 1.0, dtype?: DataType, seed?: number, |
| 254 | name = 'truncatedNormal'): LayerVariable { |
| 255 | // TODO(cais): Implement logic for dtype and seed once they are supported |
| 256 | // by deeplearn.js. |
| 257 | dtype = dtype || 'float32'; |
| 258 | if (dtype !== 'float32' && dtype !== 'int32') { |
| 259 | throw new NotImplementedError( |
| 260 | `randomNormal does not support dType ${dtype}.`); |
| 261 | } |
| 262 | return new LayerVariable( |
| 263 | tfc.truncatedNormal(shape, mean, stddev, dtype, seed), dtype, name); |
| 264 | } |
| 265 | /** |
| 266 | * Get a Variable with normal distribution of values. |
| 267 | * @param shape Shape of the tensor. |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…