mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-14 20:48:00 +00:00
### Description
allow creating (u)int64 tensors from either a number array or a bigint
array.
before:
```js
// TypeScript think is good, but actually does not work
// runtime error: Uncaught TypeError: Cannot convert 1 to a BigInt
const myTensor1 = new Tensor('int64', [1, 2, 3, 4], [2, 2]);
// runtime good, but TypeScript thinks myTensor2 is a string tensor
const myTensor2 = new Tensor('int64', [1n, 2n, 3n, 4n], [2, 2]);
```
after:
```js
// both work at runtime and TypeScript populates the correct types
const myTensor1 = new Tensor('int64', [1, 2, 3, 4], [2, 2]);
const myTensor2 = new Tensor('int64', [1n, 2n, 3n, 4n], [2, 2]);
```
|
||
|---|---|---|
| .. | ||
| backend-impl.ts | ||
| backend.ts | ||
| env-impl.ts | ||
| env.ts | ||
| index.ts | ||
| inference-session-impl.ts | ||
| inference-session.ts | ||
| onnx-value.ts | ||
| tensor-conversion-impl.ts | ||
| tensor-conversion.ts | ||
| tensor-factory-impl.ts | ||
| tensor-factory.ts | ||
| tensor-impl.ts | ||
| tensor-utils-impl.ts | ||
| tensor-utils.ts | ||
| tensor.ts | ||
| version.ts | ||