(
shape: number[], dtype: DataType,
values?: BackendValues|string[])
| 781 | } |
| 782 | |
| 783 | makeTensorInfo( |
| 784 | shape: number[], dtype: DataType, |
| 785 | values?: BackendValues|string[]): TensorInfo { |
| 786 | let dataId; |
| 787 | if (dtype === 'string' && values != null && values.length > 0 && |
| 788 | util.isString(values[0])) { |
| 789 | const encodedValues = |
| 790 | (values as unknown as string[]).map(d => util.encodeString(d)); |
| 791 | |
| 792 | dataId = this.write(encodedValues, shape, dtype); |
| 793 | } else { |
| 794 | dataId = this.write(values as TypedArray, shape, dtype); |
| 795 | } |
| 796 | |
| 797 | this.texData.get(dataId).usage = null; |
| 798 | return {dataId, shape, dtype}; |
| 799 | } |
| 800 | |
| 801 | private makeOutput<T extends Tensor>( |
| 802 | shape: number[], dtype: DataType, values?: BackendValues): T { |
no test coverage detected