pytorch / 2 / generated / torch.nn.functional.bilinear.html

torch.nn.functional.bilinear

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

Applies a bilinear transformation to the incoming data: y = x 1 T A x 2 + b y = x_1^T A x_2 + b

Shape:

  • input1: ( N , , H i n 1 ) (N, *, H_{in1}) where H i n 1 = in1_features H_{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 , , H i n 2 ) (N, *, H_{in2}) where H i n 2 = in2_features H_{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 , , H o u t ) (N, *, H_{out}) where H o u t = out_features H_{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