I’ve been using the pre-trained FasterRCNNResnet50FPN model for object detection and noticed a behavior that was unexpected (at least to me).  If one inferences with a single channel image (e.g. grayscale) the normalization process subtracts a 3-channel mean (RGB) and the result is a 3-channel tensor–so inference works (because the ResNet50 backbone expects a 3-channel input).  I understand that the way Python broadcasts arrays (tensors) is what causes the shape to be altered in this way.  For reference, it is this line 1 that causes the reshaping.
My question is: is this reshaping expected behavior?  I mean that in the sense of, if I input a grayscale image, would I expect the model to implicitly make it RGB (by duplicating channels and subtracting the RGB mean)?  or should I expect the model to just “crash” (and complain that the input shape is not correct)?  Or at least provide a warning–that an input shape was implicitly resized?