What is the use of function build in custom layers in tensorflow keras?
build is called by the __call__ function which is implemented in the parent Layer class.
From the TF docs:
https://www.tensorflow.org/api_docs/python/tf/keras/layers/Layer
&quot;build(self, input_shape): This method can be used to create weights that depend on the shape(s) of the input(s), using add_weight(). __call__() will automatically build the layer (if it has not been built yet) by calling build().&quot;