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 output(self, *inputs, **kwargs):
      gating_value = inputs[self.gate_index]
      other_values = exclude_index(inputs, self.gate_index)
      output_values = []
  
      for i, other_value in enumerate(other_values):
          n_feature_dim = other_value.shape.ndims - 1
          gate = tf.reshape(
              gating_value[:, i], [-1] + [1] * n_feature_dim
          )
          output_value = tf.multiply(other_value, gate)
          output_values.append(output_value)
  
      return sum(output_values)
  
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 4 for calling the GatedAverage obj's underlying member method code with example usage: obj.output() and returns: sum