class_docstr: Layer that computes a matching matrix between samples in two tensors.
  
  :param normalize: Whether to L2-normalize samples along the
      dot product axis before taking the dot product.
      If set to True, then the output of the dot product
      is the cosine proximity between the two samples.
  :param matching_type: the similarity function for matching
  :param kwargs: Standard layer keyword arguments.
  
  Examples:
      >>> import matchzoo as mz
      >>> layer = mz.layers.MatchingLayer(matching_type='dot',
      ...                                 normalize=True)
      >>> num_batch, left_len, right_len, num_dim = 5, 3, 2, 10
      >>> layer.build([[num_batch, left_len, num_dim],
      ...              [num_batch, right_len, num_dim]])
class_docstr_tok: ["Layer","that","computes","a","matching","matrix","between","samples","in","two","tensors",".",":","param","normalize",":","Whether","to","L2-normalize","samples","along","the","dot","product","axis","before","taking","the","dot","product",".","If","set","to","True",",","then","the","output","of","the","dot","product","is","the","cosine","proximity","between","the","two","samples",".",":","param","matching_type",":","the","similarity","function","for","matching",":","param","kwargs",":","Standard","layer","keyword","arguments",".","Examples",":",">",">",">","import","matchzoo","as","mz",">",">",">","layer","=","mz.layers.MatchingLayer","(","matching_type='dot","'",",","...","normalize=True",")",">",">",">","num_batch",",","left_len",",","right_len",",","num_dim","=","5",",","3",",","2",",","10",">",">",">","layer.build","(","[","[","num_batch",",","left_len",",","num_dim","]",",","...","[","num_batch",",","right_len",",","num_dim","]","]",")"]
docstr: Calculate the layer output shape.
  
  :param input_shape: the shapes of the input tensors,
      for MatchingLayer we need tow input tensors.
docstr_tok: ["Calculate","the","layer","output","shape",".",":","param","input_shape",":","the","shapes","of","the","input","tensors",",","for","MatchingLayer","we","need","tow","input","tensors","."]
code: def compute_output_shape(self, input_shape: list) -> tuple:
      """
      Calculate the layer output shape.
  
      :param input_shape: the shapes of the input tensors,
          for MatchingLayer we need tow input tensors.
      """
      if not isinstance(input_shape, list) or len(input_shape) != 2:
          raise ValueError(
              "A `MatchingLayer` layer should be called "
              "on a list of 2 inputs."
          )
      shape1 = list(input_shape[0])
      shape2 = list(input_shape[1])
      if len(shape1) != 3 or len(shape2) != 3:
          raise ValueError(
              "A `MatchingLayer` layer should be called "
              "on 2 inputs with 3 dimensions."
          )
      if shape1[0] != shape2[0] or shape1[2] != shape2[2]:
          raise ValueError(
              "A `MatchingLayer` layer should be called "
              "on 2 inputs with same 0,2 dimensions."
          )
  
      if self._matching_type in ["mul", "plus", "minus"]:
          return shape1[0], shape1[1], shape2[1], shape1[2]
      elif self._matching_type == "dot":
          return shape1[0], shape1[1], shape2[1], 1
      elif self._matching_type == "concat":
          return shape1[0], shape1[1], shape2[1], shape1[2] + shape2[2]
      else:
          raise ValueError(
              f"Invalid `matching_type`."
              f"{self._matching_type} received."
              f"Must be in `mul`, `plus`, `minus` "
              f"`dot` and `concat`."
          )
  
file_path: MatchZoo/matchzoo/layers/matching_layer.py
imports: import typing
  import tensorflow
  from keras.engine import Layer
label_desc: Use image node_id 5 for calling the MatchingLayer obj's underlying member method code with example usage: obj.compute_output_shape(input_shape) and returns: shape1,  shape1,  shape2,  shape1, shape1,  shape1,  shape2,  int, shape1,  shape1,  shape2,  unknown