class_docstr: Merge block to merge multiple nodes into one.
  
  # Arguments
      merge_type: String. 'add' or 'concatenate'. If left unspecified, it will
          be tuned automatically.
class_docstr_tok: ["Merge","block","to","merge","multiple","nodes","into","one",".","#","Arguments","merge_type",":","String",".","'add","'","or","'concatenate","'",".","If","left","unspecified",",","it","will","be","tuned","automatically","."]
code: def build(self, hp, inputs=None):
      inputs = nest.flatten(inputs)
      if len(inputs) == 1:
          return inputs
  
      if not all(
          [
              shape_compatible(input_node.shape, inputs[0].shape)
              for input_node in inputs
          ]
      ):
          inputs = [
              Flatten().build(hp, input_node) for input_node in inputs
          ]
  
      # TODO: Even inputs have different shape[-1], they can still be Add(
      #  ) after another layer. Check if the inputs are all of the same
      #  shape
      if self._inputs_same_shape(inputs):
          merge_type = self.merge_type or hp.Choice(
              "merge_type", ["add", "concatenate"], default="add"
          )
          if merge_type == "add":
              return layers.Add()(inputs)
  
      return layers.Concatenate()(inputs)
  
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 3 for calling the Merge obj's underlying member method code with example usage: obj.build(hp, inputs) and returns: layers, inputs, layers