From my opinion, it is better to have a fixed input shape. If the layers you are mentioned is convolution layers. Then it can generally handle multiple shapes. Can you provide more information on this question ? The convolution parameters are generally fixed and it doesn’t change on the input shape.