class_docstr: Applies a bilinear transformation to the incoming data: :math:`y = x_1^T A x_2 + b`.
  
  Args:
      in1_features: size of each first input sample
      in2_features: size of each second input sample
      out_features: size of each output sample
      bias: If set to False, the layer will not learn an additive bias.
          Default: ``True``
  
  Shape:
      - Input1: :math:`(*, H_{in1})` where :math:`H_{in1}=\text{in1\_features}` and
        :math:`*` means any number of additional dimensions including none. All but the last dimension
        of the inputs should be the same.
      - Input2: :math:`(*, H_{in2})` where :math:`H_{in2}=\text{in2\_features}`.
      - Output: :math:`(*, H_{out})` where :math:`H_{out}=\text{out\_features}`
        and all but the last dimension are the same shape as the input.
  
  Attributes:
      weight: the learnable weights of the module of shape
          :math:`(\text{out\_features}, \text{in1\_features}, \text{in2\_features})`.
          The values are initialized from :math:`\mathcal{U}(-\sqrt{k}, \sqrt{k})`, where
          :math:`k = \frac{1}{\text{in1\_features}}`
      bias:   the learnable bias of the module of shape :math:`(\text{out\_features})`.
              If :attr:`bias` is ``True``, the values are initialized from
              :math:`\mathcal{U}(-\sqrt{k}, \sqrt{k})`, where
              :math:`k = \frac{1}{\text{in1\_features}}`
  
  Examples::
  
      >>> m = nn.Bilinear(20, 30, 40)
      >>> input1 = torch.randn(128, 20)
      >>> input2 = torch.randn(128, 30)
      >>> output = m(input1, input2)
      >>> print(output.size())
      torch.Size([128, 40])
class_docstr_tok: ["Applies","a","bilinear","transformation","to","the","incoming","data",":",":","math",":","`","y","=","x_1^T","A","x_2","+","b","`",".","Args",":","in1_features",":","size","of","each","first","input","sample","in2_features",":","size","of","each","second","input","sample","out_features",":","size","of","each","output","sample","bias",":","If","set","to","False",",","the","layer","will","not","learn","an","additive","bias",".","Default",":","``","True","``","Shape",":","-","Input1",":",":","math",":","`","(","*",",","H_","{","in1","}",")","`","where",":","math",":","`","H_","{","in1","}","=\\text","{","in1\\_features","}","`","and",":","math",":","`","*","`","means","any","number","of","additional","dimensions","including","none",".","All","but","the","last","dimension","of","the","inputs","should","be","the","same",".","-","Input2",":",":","math",":","`","(","*",",","H_","{","in2","}",")","`","where",":","math",":","`","H_","{","in2","}","=\\text","{","in2\\_features","}","`",".","-","Output",":",":","math",":","`","(","*",",","H_","{","out","}",")","`","where",":","math",":","`","H_","{","out","}","=\\text","{","out\\_features","}","`","and","all","but","the","last","dimension","are","the","same","shape","as","the","input",".","Attributes",":","weight",":","the","learnable","weights","of","the","module","of","shape",":","math",":","`","(","\\text","{","out\\_features","}",",","\\text","{","in1\\_features","}",",","\\text","{","in2\\_features","}",")","`",".","The","values","are","initialized","from",":","math",":","`","\\mathcal","{","U","}","(","-\\sqrt","{","k","}",",","\\sqrt","{","k","}",")","`",",","where",":","math",":","`","k","=","\\frac","{","1","}","{","\\text","{","in1\\_features","}","}","`","bias",":","the","learnable","bias","of","the","module","of","shape",":","math",":","`","(","\\text","{","out\\_features","}",")","`",".","If",":","attr",":","`","bias","`","is","``","True","``",",","the","values","are","initialized","from",":","math",":","`","\\mathcal","{","U","}","(","-\\sqrt","{","k","}",",","\\sqrt","{","k","}",")","`",",","where",":","math",":","`","k","=","\\frac","{","1","}","{","\\text","{","in1\\_features","}","}","`","Examples",":",":",">",">",">","m","=","nn.Bilinear","(","20",",","30",",","40",")",">",">",">","input1","=","torch.randn","(","128",",","20",")",">",">",">","input2","=","torch.randn","(","128",",","30",")",">",">",">","output","=","m","(","input1",",","input2",")",">",">",">","print","(","output.size","(",")",")","torch.Size","(","[","128",",","40","]",")"]
code: def __init__(
      self,
      in1_features: int,
      in2_features: int,
      out_features: int,
      bias: bool = True,
      device=None,
      dtype=None,
  ) -> None:
      factory_kwargs = {"device": device, "dtype": dtype}
      super().__init__()
      self.in1_features = in1_features
      self.in2_features = in2_features
      self.out_features = out_features
      self.weight = Parameter(
          torch.empty(
              (out_features, in1_features, in2_features),
              **factory_kwargs,
          )
      )
  
      if bias:
          self.bias = Parameter(
              torch.empty(out_features, **factory_kwargs)
          )
      else:
          self.register_parameter("bias", None)
      self.reset_parameters()
  
imports: import math
  from typing import Any
  import torch
  from torch import Tensor
  from torch.nn.parameter import Parameter, UninitializedParameter
  from ..None import functional
  from ..None import init
  from .module import Module
  from .lazy import LazyModuleMixin
label_desc: Use image node_id 1 to create a new Bilinear object from inherited base classes: Module with example: obj = Bilinear(in1_features, in2_features, out_features, bias, device, dtype)