code: public static INDArray col2im(INDArray col, int sH, int sW, int ph, int pW, int kH, int kW) {
          if (col.rank() != 6)
              throw new IllegalArgumentException("col2im input array must be rank 6");
  
          INDArray output = Nd4j.create(col.dataType(), new long[]{col.size(0), col.size(1), kH, kW});
  
          val cfg = Conv2DConfig.builder()
                  .sH(sH)
                  .sW(sW)
                  .dH(1)
                  .dW(1)
                  .kH(kH)
                  .kW(kW)
                  .pH(ph)
                  .pW(pW)
                  .build();
  
          Col2Im col2Im = Col2Im.builder()
                  .inputArrays(new INDArray[]{col})
                  .outputs(new INDArray[]{output})
                  .conv2DConfig(cfg)
                  .build();
  
          Nd4j.getExecutioner().execAndReturn(col2Im);
          return col2Im.outputArguments()[0];
      }
docs: Rearrange matrix
  columns into blocks
  
  @param col the column
  transposed image to convert
  @param sH  stride height
  @param sW  stride width
  @param ph  padding height
  @param pW  padding width
  @param kH  height
  @param kW  width
  @return