File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ class TensorProxy {
19
19
get ( target , property ) {
20
20
switch ( property ) {
21
21
case 'data' :
22
- return target . data . c ;
22
+ return target . data ?. c ?? target . data ;
23
23
24
24
default :
25
25
return target [ property ] ;
@@ -90,11 +90,10 @@ class InferenceSession {
90
90
for ( const key in inputs ) {
91
91
if ( Object . hasOwn ( inputs , key ) ) {
92
92
const tensorLike = inputs [ key ] ;
93
- const { type, data, dims } = tensorLike ;
93
+ // NOTE:(kallebysantos) we first apply the proxy because data could be either TypedArray or {ty: DataType, c: TypedArray}
94
+ const { type, data, dims } = TensorProxy . fromTensor ( tensorLike ) ;
94
95
95
- sessionInputs [ key ] = tensorLike instanceof Tensor
96
- ? tensorLike
97
- : new Tensor ( type , data , dims ) ;
96
+ sessionInputs [ key ] = new Tensor ( type , data , dims ) ;
98
97
}
99
98
}
100
99
You can’t perform that action at this time.
0 commit comments