function getNoiseShape(x, noiseShape) {
    if (noiseShape == null) return x.shape.slice();
    if (_util.arraysEqual(x.shape, noiseShape)) return noiseShape;
    if (x.shape.length === noiseShape.length) {
        const newDimension = [];
        for(let i = 0; i < x.shape.length; i++)if (noiseShape[i] == null && x.shape[i] != null) newDimension.push(x.shape[i]);
        else newDimension.push(noiseShape[i]);
        return newDimension;
    }
    return noiseShape;
}
Normalize noise shape based on provided tensor and noise shape.

@param x Tensor.
@param noiseShape The shape for the randomly generated keep/drop flags, as
  an array of numbers. Optional.
@returns Normalized noise shape.