class_docstr: A multi-layer perceptron module.
docstr: Connects the module to some inputs.
  
  Args:
    inputs: A Tensor of shape `[batch_size, input_size]`.
    is_training: A bool indicating if we are currently training. Defaults to
      `None`. Required if using dropout.
  
  Returns:
    output: The output of the model of size `[batch_size, output_size]`.
code: def __call__(self, inputs: tf.Tensor, is_training=None) -> tf.Tensor:
      """Connects the module to some inputs.
  
      Args:
        inputs: A Tensor of shape `[batch_size, input_size]`.
        is_training: A bool indicating if we are currently training. Defaults to
          `None`. Required if using dropout.
  
      Returns:
        output: The output of the model of size `[batch_size, output_size]`.
      """
      use_dropout = self._dropout_rate not in (None, 0)
      if use_dropout and is_training is None:
          raise ValueError(
              "The `is_training` argument is required when dropout is used."
          )
      elif not use_dropout and is_training is not None:
          raise ValueError(
              "The `is_training` argument should only be used with dropout."
          )
  
      num_layers = len(self._layers)
  
      for i, layer in enumerate(self._layers):
          inputs = layer(inputs)
          if i < (num_layers - 1) or self._activate_final:
              # Only perform dropout if we are activating the output.
              if use_dropout and is_training:
                  inputs = tf.nn.dropout(
                      inputs, rate=self._dropout_rate
                  )
              inputs = self._activation(inputs)
  
      return inputs
  
file_path: sonnet/sonnet/src/nets/mlp.py
imports: from typing import Callable, Iterable, Optional
  from sonnet.src import base
  from sonnet.src import initializers
  from sonnet.src import linear
  import tensorflow
label_desc: Use image node_id 2 for calling the MLP obj's underlying member method code with example usage: obj.__call__(inputs, is_training) and returns: inputs