static isValidBroadcast(shape, finalShape) {
        // align shape to the right
        const inputRank = shape.length;
        const finalRank = finalShape.length;
        if (inputRank > finalRank) {
            return false;
        }
        for (let i = 1; i <= inputRank; i++) {
            if (shape[inputRank - i] !== 1 && shape[inputRank - i] !== finalShape[finalRank - i]) {
                return false;
            }
        }
        return true;
    }
/**
     * Determine if a shape is unidirectional broadcastable to another shape
     * @param shape The input shape
     * @param finalShape The desired shape after broadcasting
     */
Determine if a shape is unidirectional broadcastable to another shape
@param shape The input shape
@param finalShape The desired shape after broadcasting
Determine if a shape is unidirectional broadcastable to another shape @param shape The input shape @param finalShape The desired shape after broadcasting
static isValidBroadcast(shape, finalShape) {
        const inputRank = shape.length;
        const finalRank = finalShape.length;
        if (inputRank > finalRank) {
            return false;
        }
        for (let i = 1; i <= inputRank; i++) {
            if (shape[inputRank - i] !== 1 && shape[inputRank - i] !== finalShape[finalRank - i]) {
                return false;
            }
        }
        return true;
    }
static isValidBroadcast ( shape , finalShape ) { const inputRank = shape . length ; const finalRank = finalShape . length ; if ( inputRank > finalRank ) { return false ; } for ( let i = 1 ; i <= inputRank ; i ++ ) { if ( shape [ inputRank - i ] !== 1 && shape [ inputRank - i ] !== finalShape [ finalRank - i ] ) { return false ; } } return true ; }
Determine if a shape is unidirectional broadcastable to another shape
 @param shape The input shape
 @param finalShape The desired shape after broadcasting
Determine if a shape is unidirectional broadcastable to another shape @param shape The input shape @param finalShape The desired shape after broadcasting
// align shape to the right