tensorflow – How does Keras determine the batch_size automatically in layers (i.e. Conv2D)?

I created a custom Keras layer class that takes in a tensor and returns a tensor (it’s used as an intermediate layer in the middle of my model). In trying to fix shaping errors, I have been trying to look at Keras docs and other StackOverflow errors such as Keras LSTM input dimension setting and Custom Layer in Keras – Dimension Problem.

My question is how does Keras automatically regulate the batch_size and in what step does it adjust it?

For further clarification, I mean how does it populate the None value in (None, 1, 128, 1) gained from using model.summary(), for example.

P.S. sorry if the formatting or explanation is not clear, it’s my first StackOverflow question. Thank you for the help! 🙂