'Internal method to create an inbound node for the layer.
# Arguments
input_tensors: list of input tensors.
output_tensors: list of output tensors.
input_masks: list of input masks (a mask can be a tensor, or None).
output_masks: list of output masks (a mask can be a tensor, or None).
input_shapes: list of input shape tuples.
output_shapes: list of output shape tuples.
arguments: dictionary of keyword arguments that were passed to the
`call` method of the layer at the call that created the node.'

def _add_inbound_node(self, input_tensors, output_tensors, input_masks, output_masks, input_shapes, output_shapes, arguments=None):

    input_tensors = _to_list(input_tensors)
    output_tensors = _to_list(output_tensors)
    input_masks = _to_list(input_masks)
    output_masks = _to_list(output_masks)
    input_shapes = _to_list(input_shapes)
    output_shapes = _to_list(output_shapes)
    inbound_layers = []
    node_indices = []
    tensor_indices = []
    for x in input_tensors:
        if hasattr(x, '_keras_history'):
            (inbound_layer, node_index, tensor_index) = x._keras_history
            inbound_layers.append(inbound_layer)
            node_indices.append(node_index)
            tensor_indices.append(tensor_index)
        else:
            inbound_layers.append(None)
            node_indices.append(None)
            tensor_indices.append(None)
    Node(self, inbound_layers=inbound_layers, node_indices=node_indices, tensor_indices=tensor_indices, input_tensors=input_tensors, output_tensors=output_tensors, input_masks=input_masks, output_masks=output_masks, input_shapes=input_shapes, output_shapes=output_shapes, arguments=arguments)
    for i in range(len(output_tensors)):
        output_tensors[i]._keras_shape = output_shapes[i]
        uses_lp = any([getattr(x, '_uses_learning_phase', False) for x in input_tensors])
        uses_lp = (getattr(self, 'uses_learning_phase', False) or uses_lp)
        output_tensors[i]._uses_learning_phase = (getattr(output_tensors[i], '_uses_learning_phase', False) or uses_lp)
        output_tensors[i]._keras_history = (self, (len(self.inbound_nodes) - 1), i)
