@ Override public void swap ( INDArray x , INDArray y ) { if ( Nd4j . getExecutioner ( ) . getProfilingMode ( ) == OpExecutioner . ProfilingMode . ALL ) OpProfiler . getInstance ( ) . processBlasCall ( false , x , y ) ; if ( x . isSparse ( ) || y . isSparse ( ) ) { Nd4j . getSparseBlasWrapper ( ) . level1 ( ) . swap ( x , y ) ; return ; } if ( x . data ( ) . dataType ( ) == DataType . DOUBLE ) { DefaultOpExecutioner . validateDataType ( DataType . DOUBLE , x , y ) ; dswap ( x . length ( ) , x , BlasBufferUtil . getBlasStride ( x ) , y , BlasBufferUtil . getBlasStride ( y ) ) ; } else { DefaultOpExecutioner . validateDataType ( DataType . FLOAT , x , y ) ; sswap ( x . length ( ) , x , BlasBufferUtil . getBlasStride ( x ) , y , BlasBufferUtil . getBlasStride ( y ) ) ; } }
swaps a vector with another vector .