MCPcopy
hub / github.com/tensorflow/tfjs / onesVariable

Function onesVariable

tfjs-layers/src/variables.ts:191–196  ·  view source on GitHub ↗
(
    shape: Shape, dtype?: DataType, name?: string)

Source from the content-addressed store, hash-verified

189 * @return An all-ones Variable.
190 */
191export function onesVariable(
192 shape: Shape, dtype?: DataType, name?: string): LayerVariable {
193 // TODO(cais): Implement logic for dtype.
194 const allocated = tfc.ones(shape);
195 return new LayerVariable(allocated, dtype, name);
196}
197
198/**
199 * Instantiates an all-ones tensor of the same shape as another tensor.

Callers 1

topology_test.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…