1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
| // Copyright (c) Microsoft Corporation. All rights reserved.
| // Licensed under the MIT License.
|
| import { Tensor, TypedTensor } from 'onnxruntime-common';
|
| // construct from type, data (string array) and shape (number array)
| //
| // {type-tests}|pass
| new Tensor('string', ['a', 'b', 'c', 'd'], [2, 2]) as TypedTensor<'string'>;
|
| // construct from type and data (string array)
| //
| // {type-tests}|pass
| new Tensor('string', ['a', 'b', 'c', 'd']) as TypedTensor<'string'>;
|
| // construct from data (string array)
| //
| // {type-tests}|pass
| new Tensor(['a', 'b', 'c', 'd']) as TypedTensor<'string'>;
|
|