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

Function ones

tfjs-core/src/engine.ts:1284–1287  ·  view source on GitHub ↗
(shape: number[])

Source from the content-addressed store, hash-verified

1282}
1283
1284function ones(shape: number[]): Tensor {
1285 const values = makeOnesTypedArray(sizeFromShape(shape), 'float32');
1286 return ENGINE.makeTensor(values, shape, 'float32');
1287}
1288
1289export function getOrMakeEngine(): Engine {
1290 const ns = getGlobalNamespace() as unknown as {_tfengine: Engine};

Callers 15

applyMethod · 0.90
applyMethod · 0.90
models_test.tsFile · 0.90
getInputsFunction · 0.90
getExpectedOutputsFunction · 0.90
topology_test.tsFile · 0.90
training_test.tsFile · 0.90
createDenseModelAndDataFunction · 0.90
prepDataFunction · 0.90

Calls 3

makeOnesTypedArrayFunction · 0.90
sizeFromShapeFunction · 0.90
makeTensorMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…