File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -619,7 +619,7 @@ export class Tensor<R extends Rank = Rank> {
619619 if ( this . dtype === 'string' ) {
620620 const bytes = await data as Uint8Array [ ] ;
621621 try {
622- return bytes . map ( b => util . decodeString ( b ) ) ;
622+ return bytes . map ( b => util . decodeString ( b ) ) as DataTypeMap [ D ] ;
623623 } catch {
624624 throw new Error (
625625 'Failed to decode the string bytes into utf-8. ' +
@@ -639,7 +639,8 @@ export class Tensor<R extends Rank = Rank> {
639639 const data = trackerFn ( ) . readSync ( this . dataId ) ;
640640 if ( this . dtype === 'string' ) {
641641 try {
642- return ( data as Uint8Array [ ] ) . map ( b => util . decodeString ( b ) ) ;
642+ return ( data as Uint8Array [ ] ) . map ( b => util . decodeString ( b ) ) as
643+ DataTypeMap [ D ] ;
643644 } catch {
644645 throw new Error (
645646 'Failed to decode the string bytes into utf-8. ' +
You can’t perform that action at this time.
0 commit comments