class_docstr: Head layer for network outputs.
class_docstr_tok: ["Head","layer","for","network","outputs","."]
docstr: Call the layer.
docstr_tok: ["Call","the","layer","."]
code: def call(self, inputs, training, pooled_features_only):
      """Call the layer."""
      outputs = self._relu_fn(
          self._bn(self._conv_head(inputs), training=training)
      )
      self.endpoints["head_1x1"] = outputs
  
      if self._global_params.local_pooling:
          shape = outputs.get_shape().as_list()
          kernel_size = [1, shape[self.h_axis], shape[self.w_axis], 1]
          outputs = tf.nn.avg_pool(
              outputs,
              ksize=kernel_size,
              strides=[1, 1, 1, 1],
              padding="VALID",
          )
          self.endpoints["pooled_features"] = outputs
          if not pooled_features_only:
              if self._dropout:
                  outputs = self._dropout(outputs, training=training)
              self.endpoints["global_pool"] = outputs
              if self._fc:
                  outputs = tf.squeeze(
                      outputs, [self.h_axis, self.w_axis]
                  )
                  outputs = self._fc(outputs)
              self.endpoints["head"] = outputs
      else:
          outputs = self._avg_pooling(outputs)
          self.endpoints["pooled_features"] = outputs
          if not pooled_features_only:
              if self._dropout:
                  outputs = self._dropout(outputs, training=training)
              self.endpoints["global_pool"] = outputs
              if self._fc:
                  outputs = self._fc(outputs)
              self.endpoints["head"] = outputs
      return outputs
  
imports: import collections
  import itertools
  import math
  from absl import logging
  import numpy
  import six
  from six.moves import xrange
  import tensorflow
  import utils
label_desc: Use image node_id 2 for calling the Head obj's underlying member method code with example usage: obj.call(inputs, training, pooled_features_only) and returns: outputs