class_docstr: Biaffine layer for first-order scoring.
  
  This function has a tensor of weights :math:`W` and bias terms if needed.
  The score :math:`s(x, y)` of the vector pair :math:`(x, y)` is computed as :math:`x^T W y`,
  in which :math:`x` and :math:`y` can be concatenated with bias terms.
  
  References:
      - Timothy Dozat and Christopher D. Manning. 2017.
        `Deep Biaffine Attention for Neural Dependency Parsing`_.
  
  Args:
      n_in (int):
          The size of the input feature.
      n_out (int):
          The number of output channels.
      bias_x (bool):
          If ``True``, adds a bias term for tensor :math:`x`. Default: ``True``.
      bias_y (bool):
          If ``True``, adds a bias term for tensor :math:`y`. Default: ``True``.
  
  .. _Deep Biaffine Attention for Neural Dependency Parsing:
      https://openreview.net/forum?id=Hk95PK9le
class_docstr_tok: ["Biaffine","layer","for","first-order","scoring",".","This","function","has","a","tensor","of","weights",":","math",":","`","W","`","and","bias","terms","if","needed",".","The","score",":","math",":","`","s","(","x",",","y",")","`","of","the","vector","pair",":","math",":","`","(","x",",","y",")","`","is","computed","as",":","math",":","`","x^T","W","y","`",",","in","which",":","math",":","`","x","`","and",":","math",":","`","y","`","can","be","concatenated","with","bias","terms",".","References",":","-","Timothy","Dozat","and","Christopher","D.","Manning",".","2017",".","`","Deep","Biaffine","Attention","for","Neural","Dependency","Parsing","`","_",".","Args",":","n_in","(","int",")",":","The","size","of","the","input","feature",".","n_out","(","int",")",":","The","number","of","output","channels",".","bias_x","(","bool",")",":","If","``","True","``",",","adds","a","bias","term","for","tensor",":","math",":","`","x","`",".","Default",":","``","True","``",".","bias_y","(","bool",")",":","If","``","True","``",",","adds","a","bias","term","for","tensor",":","math",":","`","y","`",".","Default",":","``","True","``",".","..","_Deep","Biaffine","Attention","for","Neural","Dependency","Parsing",":","https",":","\/\/openreview.net\/forum","?","id=Hk95PK9le"]
code: def __init__(self, n_in, n_out=1, bias_x=True, bias_y=True):
      super().__init__()
  
      self.n_in = n_in
      self.n_out = n_out
      self.bias_x = bias_x
      self.bias_y = bias_y
      self.weight = nn.Parameter(
          torch.Tensor(n_out, n_in + bias_x, n_in + bias_y)
      )
  
      self.reset_parameters()
  
imports: import torch
  import torch.nn
  from torch.nn.utils.rnn import pack_padded_sequence, PackedSequence
  from torch.nn.modules.rnn import apply_permutation
label_desc: Use image node_id 1 to create a new Biaffine object from inherited base classes: nn with example: obj = Biaffine(n_in, n_out, bias_x, bias_y)