build() creates a Keras layer’s weights after the layer receives its input shape. This delayed setup matters because weight dimensions depend on that shape. The layer’s computation belongs in call(). section 3.6.2
Building a shape-dependent custom layer
A custom SimpleDense layer receives input_shape in build(), extracts the input dimension, and creates W and b. Its call() method then computes the output. Calling it with shape (2, 784) creates an output with shape (2, 32). section 3.6.2
Layers are built lazily:
- A model can also be built explicitly with build(input_shape), allowing its weights and summary to be inspected before data passes through it. section 7.2.1
- Providing input_shape in advance lets a Sequential model build while layers are added and supports shape-summary debugging. section 7.2.1

