class_docstr: This `Module` represents a gated sum of two tensors `a` and `b`. Specifically:
  ```
  f = activation(W [a; b])
  out = f * a + (1 - f) * b
  ```
  
  # Parameters
  
  input_dim : `int`, required
      The dimensionality of the input. We assume the input have shape `(..., input_dim)`.
  activation : `Activation`, optional (default = `torch.nn.Sigmoid()`)
      The activation function to use.
code: def forward(
      self, input_a: torch.Tensor, input_b: torch.Tensor
  ) -> torch.Tensor:
      if input_a.size() != input_b.size():
          raise ValueError("The input must have the same size.")
      if input_a.size(-1) != self.input_dim:
          raise ValueError("Input size must match `input_dim`.")
      gate_value = self._activation(
          self._gate(torch.cat([input_a, input_b], -1))
      )
      return gate_value * input_a + (1 - gate_value) * input_b
  
file_path: allennlp/allennlp/modules/gated_sum.py
imports: import torch
  from allennlp.nn import Activation
label_desc: Use image node_id 4 for calling the GatedSum obj's underlying member method code with example usage: obj.forward(input_a, input_b) and returns: unknown