public static INDArray col2im(INDArray col, INDArray z, 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"); if (z.rank() != 4) throw new IllegalArgumentException("col2im output array must be rank 4"); Col2Im col2Im = new Col2Im(col, sy, sx, ph, pw, h, w, false, z); Nd4j.getExecutioner().exec(col2Im); return z; }
/** * Rearrange matrix * columns into blocks * @param col the column * transposed image to convert * @param sy stride y * @param sx stride x * @param ph padding height * @param pw padding width * @param h height * @param w width * @return */ 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"); Col2Im col2Im = new Col2Im(col, sy, sx, ph, pw, h, w); return Nd4j.getExecutioner().exec(col2Im).z(); }