(
value: DataType, dtype: DataType)
| 26 | * Create typed array for scalar value. Used for storing in `DataStorage`. |
| 27 | */ |
| 28 | export function createScalarValue( |
| 29 | value: DataType, dtype: DataType): BackendValues { |
| 30 | if (dtype === 'string') { |
| 31 | return encodeString(value); |
| 32 | } |
| 33 | |
| 34 | return toTypedArray([value], dtype); |
| 35 | } |
| 36 | |
| 37 | function noConversionNeeded(a: TensorLike, dtype: DataType): boolean { |
| 38 | return (a instanceof Float32Array && dtype === 'float32') || |
nothing calls this directly
no test coverage detected
searching dependent graphs…