MCPcopy Create free account
hub / github.com/tensorflow/tfjs / truncatedNormalVariable

Function truncatedNormalVariable

tfjs-layers/src/variables.ts:252–264  ·  view source on GitHub ↗
(
    shape: Shape, mean = 0.0, stddev = 1.0, dtype?: DataType, seed?: number,
    name = 'truncatedNormal')

Source from the content-addressed store, hash-verified

250 * @return The truncated-normal-random Variable.
251 */
252export 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.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…