public static IComplexNDArray padWithZeros ( IComplexNDArray nd , long [ ] targetShape ) { if ( Arrays . equals ( nd . shape ( ) , targetShape ) ) return nd ; //no padding required if ( ArrayUtil . prod ( nd . shape ( ) ) >= ArrayUtil . prod ( targetShape ) ) return nd ; IComplexNDArray ret = Nd4j . createComplex ( targetShape ) ; INDArrayIndex [ ] targetShapeIndex = NDArrayIndex . createCoveringShape ( nd . shape ( ) ) ; ret . put ( targetShapeIndex , nd ) ; return ret ; }
Pads an ndarray with zeros