public static INDArray col2im ( INDArray col , int sy , int sx , int ph , int pw , int h , int w ) { if ( col . rank ( ) != 6 ) throw new IllegalArgumentException ( "col2im input array must be rank 6" ) ; INDArray output = Nd4j . create ( new long [ ] { col . size ( 0 ) , col . size ( 1 ) , h , w } ) ; Col2Im col2Im = Col2Im . builder ( ) . inputArrays ( new INDArray [ ] { col } ) . outputs ( new INDArray [ ] { output } ) . conv2DConfig ( Conv2DConfig . builder ( ) . sy ( sy ) . sx ( sx ) . dw ( 1 ) . dh ( 1 ) . kh ( h ) . kw ( w ) . ph ( ph ) . pw ( pw ) . build ( ) ) . build ( ) ; Nd4j . getExecutioner ( ) . exec ( col2Im ) ; return col2Im . outputArguments ( ) [ 0 ] ; }
Rearrange matrix columns into blocks