public static int [ ] get3DSameModeTopLeftPadding ( int [ ] outSize , int [ ] inSize , int [ ] kernel , int [ ] strides , int [ ] dilation ) { int [ ] eKernel = effectiveKernelSize ( kernel , dilation ) ; int [ ] outPad = new int [ 3 ] ; outPad [ 0 ] = ( ( outSize [ 0 ] - 1 ) * strides [ 0 ] + eKernel [ 0 ] - inSize [ 0 ] ) / 2 ; outPad [ 1 ] = ( ( outSize [ 1 ] - 1 ) * strides [ 1 ] + eKernel [ 1 ] - inSize [ 1 ] ) / 2 ; outPad [ 2 ] = ( ( outSize [ 2 ] - 1 ) * strides [ 2 ] + eKernel [ 2 ] - inSize [ 2 ] ) / 2 ; return outPad ; }
Get top and left padding for same mode only for 3d convolutions