class_docstr: Adapts a Sonnet module to conform to the Keras Layer API.
  
      >>> layer = LayerAdapter(snt.Linear(1))
      >>> assert isinstance(layer, tf.keras.layers.Layer)
  
  We support building without ``__call__``, even with unknown dimensions:
  
      >>> layer.build(input_shape=[None, 28 * 28])
  
  Of course now features of Keras work as expected, for example layer freezing:
  
      >>> [v.name for v in layer.trainable_variables]
      ["linear/b:0", "linear/w:0"]
  
      >>> layer.trainable = False
      >>> layer.trainable_variables
      []
code: def build(self, input_shape):
      super().build(input_shape)
  
      # Trigger variable initialization by tracing the module.
      self._trace_and_initialize(input_shape)
  
      # Make sure Keras variable tracking finds our weights.
      # Keras has a setattr override which can be used to register weights in a
      # similar way to `Layer.add_weight`. By setting `_sonnet_weights` we trigger
      # this mechanism and module weights are found in `Layer.trainable_variables`
      # and `Layer.variables`.
      snt.allow_empty_variables(self.module)
      self._sonnet_weights = self.module.variables
  
imports: from absl.testing import parameterized
  import sonnet
  from sonnet.src import test_utils
  from sonnet.src.conformance import descriptors
  import tensorflow
  import tree
label_desc: Use image node_id 6 for calling the LayerAdapter obj's underlying member method code with example usage: obj.build(input_shape) without return types