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

Function tensor1d

tfjs-core/src/ops/tensor1d.ts:41–49  ·  view source on GitHub ↗
(values: TensorLike1D, dtype?: DataType)

Source from the content-addressed store, hash-verified

39 * @doc {heading: 'Tensors', subheading: 'Creation'}
40 */
41export function tensor1d(values: TensorLike1D, dtype?: DataType): Tensor1D {
42 assertNonNull(values);
43 const inferredShape = inferShape(values, dtype);
44 if (inferredShape.length !== 1) {
45 throw new Error('tensor1d() requires values to be a flat/TypedArray');
46 }
47 const shape: number[] = null;
48 return makeTensor(values, shape, inferredShape, dtype) as Tensor1D;
49}

Callers 15

constructorMethod · 0.90
models_test.tsFile · 0.90
losses_test.tsFile · 0.90
metrics_test.tsFile · 0.90
variables_test.tsFile · 0.90
gatherFunction · 0.90
testLoopMethod · 0.90
fitLoopMethod · 0.90

Calls 3

assertNonNullFunction · 0.90
inferShapeFunction · 0.90
makeTensorFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…