Skip to content
fn

bilinear_layer_op

→TensorImplPtr
int bilinear_layer_op(const int & x1, const int & x2, const int & weight, const int & bias)

Public bilinear-layer entry point.

Thin wrapper that delegates to BilinearLayerBackward::forward.

Parameters

x1TensorImplPtr
First operand of the bilinear form (last dim =D1= D_1).
x2TensorImplPtr
Second operand of the bilinear form (last dim =D2= D_2).
weightTensorImplPtr
Weight tensor of shape (D_out, D_1, D_2).
biasTensorImplPtr
Optional bias vector of shape (D_out,); pass nullptr to omit.

Returns

TensorImplPtr

Output tensor of shape (*, D_out).