I am trying to build my own custom keras layer following the documentation at
https://www.tensorflow.org/api_docs/python/tf/keras/layers/Layer
In the custom layers we need three functions call, build and init I am not able to understand where the function build gets called and what is its use.
I checked the source of Dense layer (https://github.com/tensorflow/tensorflow/blob/v2.3.0/tensorflow/python/keras/layers/core.py#L1159-L1190) in keras which is also built on top of the Layer class of tensorflow.keras and the same thing is observed there as well. I cant find any call to the function build.
Can someone please explain me what build function is for ? I mean I understand that add_weights is called inside build and it is important but where is build being called