static adjustPadAndReturnShape(inSize, stride, dilation, kernel, pads, padHeadIndex, padTailIndex, autoPad) {
        const dkernel = dilation * (kernel - 1) + 1;
        if (autoPad && autoPad !== 'NOTSET') {
            switch (autoPad) {
                case 'VALID':
                    pads[padHeadIndex] = 0;
                    pads[padTailIndex] = 0;
                    return Math.floor(((inSize - dkernel) / stride) + 1);
                case 'SAME_LOWER':
                case 'SAME_UPPER':
                    if (dilation !== 1) {
                        throw new Error('Dilation not supported for SAME_UPPER or SAME_LOWER');
                    }
                    else {
                        const legacyTargetSize = (inSize + stride - 1) / stride;
                        const padNeeded = (legacyTargetSize - 1) * stride + kernel - inSize;
                        pads[padHeadIndex] =
                            (autoPad === 'SAME_LOWER') ? Math.floor((padNeeded + 1) / 2) : Math.floor(padNeeded / 2);
                        pads[padTailIndex] = padNeeded - pads[padHeadIndex];
                        return Math.floor(((inSize + padNeeded - kernel) / stride) + 1);
                    }
                default:
                    throw new Error('Unsupported AutoPad type');
            }
        }
        else {
            return Math.floor(((inSize + pads[padHeadIndex] + pads[padTailIndex] - dkernel) / stride) + 1);
        }
    }
// adjusts pad value for given 'autoPad' string and computes output shape along a particular dimension
adjusts pad value for given 'autoPad' string and computes output shape along a particular dimension
adjusts pad value for given ' autoPad ' string and computes output shape along a particular dimension
static adjustPadAndReturnShape(inSize, stride, dilation, kernel, pads, padHeadIndex, padTailIndex, autoPad) {
        const dkernel = dilation * (kernel - 1) + 1;
        if (autoPad && autoPad !== 'NOTSET') {
            switch (autoPad) {
                case 'VALID':
                    pads[padHeadIndex] = 0;
                    pads[padTailIndex] = 0;
                    return Math.floor(((inSize - dkernel) / stride) + 1);
                case 'SAME_LOWER':
                case 'SAME_UPPER':
                    if (dilation !== 1) {
                        throw new Error('Dilation not supported for SAME_UPPER or SAME_LOWER');
                    }
                    else {
                        const legacyTargetSize = (inSize + stride - 1) / stride;
                        const padNeeded = (legacyTargetSize - 1) * stride + kernel - inSize;
                        pads[padHeadIndex] =
                            (autoPad === 'SAME_LOWER') ? Math.floor((padNeeded + 1) / 2) : Math.floor(padNeeded / 2);
                        pads[padTailIndex] = padNeeded - pads[padHeadIndex];
                        return Math.floor(((inSize + padNeeded - kernel) / stride) + 1);
                    }
                default:
                    throw new Error('Unsupported AutoPad type');
            }
        }
        else {
            return Math.floor(((inSize + pads[padHeadIndex] + pads[padTailIndex] - dkernel) / stride) + 1);
        }
    }
static adjustPadAndReturnShape ( inSize , stride , dilation , kernel , pads , padHeadIndex , padTailIndex , autoPad ) { const dkernel = dilation * ( kernel - 1 ) + 1 ; if ( autoPad && autoPad !== 'NOTSET' ) { switch ( autoPad ) { case 'VALID' : pads [ padHeadIndex ] = 0 ; pads [ padTailIndex ] = 0 ; return Math . floor ( ( ( inSize - dkernel ) / stride ) + 1 ) ; case 'SAME_LOWER' : case 'SAME_UPPER' : if ( dilation !== 1 ) { throw new Error ( 'Dilation not supported for SAME_UPPER or SAME_LOWER' ) ; } else { const legacyTargetSize = ( inSize + stride - 1 ) / stride ; const padNeeded = ( legacyTargetSize - 1 ) * stride + kernel - inSize ; pads [ padHeadIndex ] = ( autoPad === 'SAME_LOWER' ) ? Math . floor ( ( padNeeded + 1 ) / 2 ) : Math . floor ( padNeeded / 2 ) ; pads [ padTailIndex ] = padNeeded - pads [ padHeadIndex ] ; return Math . floor ( ( ( inSize + padNeeded - kernel ) / stride ) + 1 ) ; } default : throw new Error ( 'Unsupported AutoPad type' ) ; } } else { return Math . floor ( ( ( inSize + pads [ padHeadIndex ] + pads [ padTailIndex ] - dkernel ) / stride ) + 1 ) ; } }
adjusts pad value for given 'autoPad' string and computes output shape along a particular dimension
adjusts pad value for given ' autoPad ' string and computes output shape along a particular dimension