class_docstr: Layer uses applies weighted elementwise addition to multiple outputs.
  Weight can be control using separate input known as **gate**. Number
  of outputs from the gate has to be equal to the number of networks,
  since each value from the weight will be a weight per each network.
  
  Layer expects gate as a first input, but it can be controlled with
  the ``gate_index`` parameter.
  
  Parameters
  ----------
  gate_index : int
      Input layers passed as a list and current variable specifies
      index in which it can find gating network. Defaults to ``0``,
      which means that it expects to see gating layer in first position.
  
  {BaseLayer.Parameters}
  
  Methods
  -------
  {BaseLayer.Methods}
  
  Attributes
  ----------
  {BaseLayer.Attributes}
  
  Examples
  --------
  >>> from neupy.layers import *
  >>>
  >>> gate = Input(10) >> Softmax(2)
  >>> net1 = Input(20) >> Relu(10)
  >>> net2 = Input(20) >> Relu(20) >> Relu(10)
  >>>
  >>> network = (gate | net1 | net2) >> GatedAverage()
  >>> network
  [(10,), (20,), (20,)] -> [... 8 layers ...] -> 10
code: def get_output_shape(self, *input_shapes):
      input_shapes = [tf.TensorShape(shape) for shape in input_shapes]
  
      if any(shape.ndims is None for shape in input_shapes):
          return tf.TensorShape(None)
  
      self.fail_if_shape_invalid(input_shapes)
  
      if self.gate_index >= 0:
          # Take layer from the left side from the gating layer.
          # In case if gating layer at the zeros position then
          # it will take the last layer (-1 index).
          return input_shapes[self.gate_index - 1]
  
      # In case if it negative index, we take layer from the right side
      return input_shapes[self.gate_index + 1]
  
imports: import copy
  from functools import reduce
  import tensorflow
  from neupy.core.properties import FunctionWithOptionsProperty, IntProperty
  from neupy.exceptions import LayerConnectionError
  from neupy.utils import tf_utils
  from .base import BaseLayer
label_desc: Use image node_id 3 for calling the GatedAverage obj's underlying member method code with example usage: obj.get_output_shape() and returns: input_shapes, tf, input_shapes