function getBroadcastDims(inShape, outShape) {
    const inRank = inShape.length;
    const dims = [];
    for(let i = 0; i < inRank; i++){
        const dim = inRank - 1 - i;
        const a = inShape[dim] || 1;
        const b = outShape[outShape.length - 1 - i] || 1;
        if (b > 1 && a === 1) dims.unshift(dim);
    }
    return dims;
}
Returns the axes in the output space that should be reduced to produce
the input space.