class_docstr: A keras implementation of multi-perspective layer of BiMPM.
  
  For detailed information, see Bilateral Multi-Perspective
  Matching for Natural Language Sentences, section 3.2.
  
  Examples:
      >>> import matchzoo as mz
      >>> perspective={'full': True, 'max-pooling': True,
      ...     'attentive': True, 'max-attentive': True}
      >>> layer = mz.contrib.layers.MultiPerspectiveLayer(
      ...     att_dim=50, mp_dim=20, perspective=perspective)
      >>> layer.compute_output_shape(
      ...     [(32, 10, 100), (32, 50), None, (32, 50), None,
      ...     [(32, 40, 100), (32, 50), None, (32, 50), None]])
      (32, 10, 83)
class_docstr_tok: ["A","keras","implementation","of","multi-perspective","layer","of","BiMPM",".","For","detailed","information",",","see","Bilateral","Multi-Perspective","Matching","for","Natural","Language","Sentences",",","section","3.2",".","Examples",":",">",">",">","import","matchzoo","as","mz",">",">",">","perspective=","{","'full","'",":","True",",","'max-pooling","'",":","True",",","...","'attentive","'",":","True",",","'max-attentive","'",":","True","}",">",">",">","layer","=","mz.contrib.layers.MultiPerspectiveLayer","(","...","att_dim=50",",","mp_dim=20",",","perspective=perspective",")",">",">",">","layer.compute_output_shape","(","...","[","(","32",",","10",",","100",")",",","(","32",",","50",")",",","None",",","(","32",",","50",")",",","None",",","...","[","(","32",",","40",",","100",")",",","(","32",",","50",")",",","None",",","(","32",",","50",")",",","None","]","]",")","(","32",",","10",",","83",")"]
docstr: Call.
docstr_tok: ["Call","."]
code: def call(self, x: list, **kwargs):
      """Call."""
      seq_lt, seq_rt = x[:5], x[5:]
      # unpack seq_left and seq_right
      # all hidden states, last hidden state of forward pass,
      # last cell state of forward pass, last hidden state of
      # backward pass, last cell state of backward pass.
      lstm_reps_lt, forward_h_lt, _, backward_h_lt, _ = seq_lt
      lstm_reps_rt, forward_h_rt, _, backward_h_rt, _ = seq_rt
  
      match_tensor_list = []
      match_dim = 0
      if self._perspective.get("full"):
          # Each forward & backward contextual embedding compare
          # with the last step of the last time step of the other sentence.
          h_lt = tf.concat([forward_h_lt, backward_h_lt], axis=-1)
          full_match_tensor = self.full_match([h_lt, lstm_reps_rt])
          match_tensor_list.append(full_match_tensor)
          match_dim += self._mp_dim + 1
  
      if self._perspective.get("max-pooling"):
          # Each contextual embedding compare with each contextual embedding.
          # retain the maximum of each dimension.
          max_match_tensor = self.max_pooling_match(
              [lstm_reps_lt, lstm_reps_rt]
          )
          match_tensor_list.append(max_match_tensor)
          match_dim += self._mp_dim
  
      if self._perspective.get("attentive"):
          # Each contextual embedding compare with each contextual embedding.
          # retain sum of weighted mean of each dimension.
          attentive_tensor = self.attentive_match(
              [lstm_reps_lt, lstm_reps_rt]
          )
          match_tensor_list.append(attentive_tensor)
          match_dim += self._mp_dim + 1
  
      if self._perspective.get("max-attentive"):
          # Each contextual embedding compare with each contextual embedding.
          # retain max of weighted mean of each dimension.
          relevancy_matrix = _calc_relevancy_matrix(
              lstm_reps_lt, lstm_reps_rt
          )
          max_attentive_tensor = self.max_attentive_match(
              [lstm_reps_lt, lstm_reps_rt, relevancy_matrix]
          )
          match_tensor_list.append(max_attentive_tensor)
          match_dim += self._mp_dim + 1
  
      mp_tensor = tf.concat(match_tensor_list, axis=-1)
      return mp_tensor
  
imports: import tensorflow
  from keras import backend
  from keras.engine import Layer
  from matchzoo.contrib.layers.attention_layer import AttentionLayer
label_desc: Use image node_id 5 for calling the MultiPerspectiveLayer obj's underlying member method code with example usage: obj.call(x) and returns: mp_tensor