@ Override public double nrm2 ( INDArray arr ) { switch ( arr . data ( ) . dataType ( ) ) { case DOUBLE : DefaultOpExecutioner . validateDataType ( DataType . DOUBLE , arr ) ; return dnrm2 ( arr . length ( ) , arr , 1 ) ; case FLOAT : DefaultOpExecutioner . validateDataType ( DataType . FLOAT , arr ) ; return snrm2 ( arr . length ( ) , arr , 1 ) ; case HALF : return hnrm2 ( arr . length ( ) , arr , 1 ) ; default : } throw new UnsupportedOperationException ( ) ; }
Computes the Euclidean norm of a vector .