code: def build(self, hp, inputs=None):
      inputs = nest.flatten(inputs)
      utils.validate_num_inputs(inputs, 1)
      input_node = inputs[0]
      output_node = input_node
  
      # No need to reduce.
      if len(output_node.shape) <= 2:
          return output_node
  
      if self.reduction_type is not None:
          return self._build_block(hp, output_node, self.reduction_type)
  
      reduction_type = hp.Choice(
          REDUCTION_TYPE, [FLATTEN, GLOBAL_MAX, GLOBAL_AVG]
      )
      with hp.conditional_scope(REDUCTION_TYPE, [reduction_type]):
          return self._build_block(hp, output_node, reduction_type)
  
imports: from typing import Optional
  import tensorflow
  from tensorflow import nest
  from tensorflow.keras import layers
  from autokeras.engine import block
  from autokeras.utils import layer_utils
  from autokeras.utils import utils
label_desc: Use image node_id 5 for calling the Reduction obj's underlying member method code with example usage: obj.build(hp, inputs) and returns: output_node, self, self