Skip to content

Commit e04e015

Browse files
author
Mateusz Sluszniak
committed
Fix types
1 parent d001a76 commit e04e015

3 files changed

Lines changed: 3 additions & 8 deletions

File tree

docs/docs/typescript-api/ExecutorchModule.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ type ETInput =
5050
| Float64Array;
5151

5252
export interface Tensor {
53-
data: ETInput[];
53+
data: ETInput;
5454
shape: number[];
5555
}
5656
```

packages/react-native-executorch/src/modules/general/ExecutorchModule.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,8 @@ export class ExecutorchModule extends BaseModule {
2626
if (!currentInput || !currentInput.data) {
2727
throw new Error('Input tensor is undefined.');
2828
}
29-
const testingTypeElement = currentInput.data[0];
30-
if (testingTypeElement === undefined) {
31-
throw new Error('Input tensor is undefined.');
32-
}
3329

34-
let currentInputTypeIdentifier = getTypeIdentifier(testingTypeElement);
30+
let currentInputTypeIdentifier = getTypeIdentifier(currentInput.data);
3531
if (currentInputTypeIdentifier === -1) {
3632
throw new Error(getError(ETError.InvalidArgument));
3733
}

packages/react-native-executorch/src/types/common.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ export type ETInput =
1717
| Float64Array;
1818

1919
export interface Tensor {
20-
data: ETInput[];
20+
data: ETInput;
2121
shape: number[];
22-
type: ETInput;
2322
}

0 commit comments

Comments
 (0)