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 delta
      >>> layer = delta.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","delta",">",">",">","layer","=","delta.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: Build the layer.
  :param input_shape: the shapes of the input tensors,
      for MatchingLayer we need tow input tensors.
docstr_tok: ["Build","the","layer",".",":","param","input_shape",":","the","shapes","of","the","input","tensors",",","for","MatchingLayer","we","need","tow","input","tensors","."]
code: def build(self, input_shape: list):
      """
      Build the layer.
      :param input_shape: the shapes of the input tensors,
          for MatchingLayer we need tow input tensors.
      """
      # Used purely for shape validation.
      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."
          )
      self._shape1 = input_shape[0]
      self._shape2 = input_shape[1]
      for idx in 0, 2:
          if self._shape1[idx] != self._shape2[idx]:
              raise ValueError(
                  "Incompatible dimensions: "
                  f"{self._shape1[idx]} != {self._shape2[idx]}."
                  f"Layer shapes: {self._shape1}, {self._shape2}."
              )
  
file_path: delta/delta/layers/match_pyramid.py
imports: import typing
  import delta.compat
  from delta.layers.base_layer import Layer
label_desc: Use image node_id 3 for calling the MatchingLayer obj's underlying member method code with example usage: obj.build(input_shape) without return types