function grayscaleToRGB_(image) {
    const $image = (0, _tensorUtilEnv.convertToTensor)(image, "image", "grayscaleToRGB");
    const lastDimsIdx = $image.rank - 1;
    const lastDims = $image.shape[lastDimsIdx];
    _util.assert($image.rank >= 2, ()=>"Error in grayscaleToRGB: images must be at least rank 2, " + `but got rank ${$image.rank}.`);
    _util.assert(lastDims === 1, ()=>"Error in grayscaleToRGB: last dimension of a grayscale image " + `should be size 1, but got size ${lastDims}.`);
    const reps = new Array($image.rank);
    reps.fill(1, 0, lastDimsIdx);
    reps[lastDimsIdx] = 3;
    return (0, _tile.tile)($image, reps);
}
Converts images from grayscale to RGB format.

@param image A grayscale tensor to convert. The `image`'s last dimension must
    be size 1 with at least a two-dimensional shape.

@doc {heading: 'Operations', subheading: 'Images', namespace: 'image'}