torch.nn.functional.bilinear

torch.nn.functional.bilinear(input1, input2, weight, bias=None) → Tensor

Applies a bilinear transformation to the incoming data: y=x1TAx2+by = x_1^T A x_2 + b

Shape:

  • input1: (N,,Hin1)(N, *, H_{in1}) where Hin1=in1_featuresH_{in1}=\text{in1\_features} and * means any number of additional dimensions. All but the last dimension of the inputs should be the same.
  • input2: (N,,Hin2)(N, *, H_{in2}) where Hin2=in2_featuresH_{in2}=\text{in2\_features}
  • weight: (out_features,in1_features,in2_features)(\text{out\_features}, \text{in1\_features}, \text{in2\_features})
  • bias: (out_features)(\text{out\_features})
  • output: (N,,Hout)(N, *, H_{out}) where Hout=out_featuresH_{out}=\text{out\_features} and all but the last dimension are the same shape as the input.

© 2024, PyTorch Contributors
PyTorch has a BSD-style license, as found in the LICENSE file.
https://pytorch.org/docs/2.1/generated/torch.nn.functional.bilinear.html