Table of Contents
Shortcuts

# 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 y=x 1 T​A x 2​+b

  Shape:

  > - input1: (N,∗,H i n 1)(N, *, H_{in1})(N,∗,H in 1​) where H i n 1=in1_features H_{in1}=\text{in1\_features}H in 1​=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})(N,∗,H in 2​) where H i n 2=in2_features H_{in2}=\text{in2\_features}H in 2​=in2_features

  > - weight: (out_features,in1_features,in2_features)(\text{out\_features}, \text{in1\_features}, \text{in2\_features})(out_features,in1_features,in2_features)

  > - bias: (out_features)(\text{out\_features})(out_features)

  > - output: (N,∗,H o u t)(N, *, H_{out})(N,∗,H o u t​) where H o u t=out_features H_{out}=\text{out\_features}H o u t​=out_features and all but the last dimension are the same shape as the input.

## Docs

Access comprehensive developer documentation for PyTorch

View Docs

## Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

## Resources

Find development resources and get your questions answered

View Resources

To analyze traffic and optimize your experience, we serve cookies on this site. By clicking or navigating, you agree to allow our usage of cookies. As the current maintainers of this site, Facebook’s Cookies Policy applies. Learn more, including about available controls: Cookies Policy.