(values: TensorLike1D, dtype?: DataType)
| 39 | * @doc {heading: 'Tensors', subheading: 'Creation'} |
| 40 | */ |
| 41 | export 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 | } |
no test coverage detected
searching dependent graphs…