function validateUpdateShape(shape, indices, updates) {
    const sliceDim = indices.rank > 1 ? indices.shape[indices.rank - 1] : 1;
    const batchDim = indices.rank > 1 ? indices.rank - 1 : 1;
    const shapeError = "Must have updates.shape = indices.shape[:batchDim] + " + `shape[sliceDim:], got updates.shape: ${updates.shape}` + `, indices.shape: ${indices.shape}, shape: ${shape}` + `, sliceDim: ${sliceDim}, and batchDim: ${batchDim}.`;
    if (updates.rank < batchDim) throw new Error(shapeError + ` update.rank < ${batchDim}. `);
    if (shape.length < sliceDim + (updates.rank - batchDim)) throw new Error(shapeError + ` Output shape length < ${sliceDim + (updates.rank - batchDim)}`);
    if (updates.rank !== batchDim + shape.length - sliceDim) throw new Error(shapeError + ` update.rank != ${batchDim + shape.length - sliceDim}`);
    for(let d = 0; d < batchDim; ++d){
        if (updates.shape[d] !== indices.shape[d]) throw new Error(shapeError + ` updates.shape[${d}] (${updates.shape[d]}) != indices.shape[${d}] (${indices.shape[d]}).`);
    }
    for(let d = 0; d < updates.rank - batchDim; ++d){
        if (updates.shape[d + batchDim] !== shape[d + sliceDim]) throw new Error(shapeError + ` updates.shape[${d + batchDim}] (${updates.shape[d + batchDim]}) != shape[${d + batchDim}] (${shape[d + batchDim]})`);
    }
}
Calculate the shape information for the output.

@param update The tensor contains the update values.
@param indices The tensor contains the indices for the update values.
@param shape The shape of the output tensor.

@returns ScatterShapeInfo