@@ -466,8 +466,6 @@ export class Tensor {
466466 return this . permute ( ...dims ) ;
467467 }
468468
469- // TODO add .max() and .min() methods
470-
471469 /**
472470 * Returns the sum of each row of the input tensor in the given dimension dim.
473471 *
@@ -765,15 +763,13 @@ export class Tensor {
765763 if ( dim !== null ) {
766764 throw new Error ( "`dim !== null` not yet implemented." ) ;
767765 }
768- // @ts -ignore
769766 const value = min ( this . data ) [ 0 ] ;
770767 return new Tensor ( this . type , [ value ] , [ ] ) ;
771768 }
772769 max ( dim = null , keepdim = false ) {
773770 if ( dim !== null ) {
774771 throw new Error ( "`dim !== null` not yet implemented." ) ;
775772 }
776- // @ts -ignore
777773 const value = max ( this . data ) [ 0 ] ;
778774 return new Tensor ( this . type , [ value ] , [ ] ) ;
779775 }
@@ -782,15 +778,13 @@ export class Tensor {
782778 if ( dim !== null ) {
783779 throw new Error ( "`dim !== null` not yet implemented." ) ;
784780 }
785- // @ts -ignore
786781 const index = min ( this . data ) [ 1 ] ;
787782 return new Tensor ( 'int64' , [ BigInt ( index ) ] , [ ] ) ;
788783 }
789784 argmax ( dim = null , keepdim = false ) {
790785 if ( dim !== null ) {
791786 throw new Error ( "`dim !== null` not yet implemented." ) ;
792787 }
793- // @ts -ignore
794788 const index = max ( this . data ) [ 1 ] ;
795789 return new Tensor ( 'int64' , [ BigInt ( index ) ] , [ ] ) ;
796790 }
0 commit comments