Shortcuts

Class BilinearImpl

Inheritance Relationships

Base Type

Class Documentation

class BilinearImpl : public torch::nn::Cloneable<BilinearImpl>

Applies a billinear transformation with optional bias.

See https://pytorch.org/docs/main/generated/torch.nn.Bilinear.html to learn about the exact behavior of this module.

See the documentation for torch::nn::BilinearOptions class to learn what constructor arguments are supported for this module.

Example:

Bilinear model(BilinearOptions(3, 2, 4).bias(false));

Public Functions

inline BilinearImpl(int64_t in1_features, int64_t in2_features, int64_t out_features)
explicit BilinearImpl(const BilinearOptions &options_)
virtual void reset() override

reset() must perform initialization of all members with reference semantics, most importantly parameters, buffers and submodules.

void reset_parameters()
virtual void pretty_print(std::ostream &stream) const override

Pretty prints the Bilinear module into the given stream.

Tensor forward(const Tensor &input1, const Tensor &input2)

Applies a bilinear transform on the input1 and input2 tensor by multiplying with the weight and optionally adding the bias, if with_bias is true in the options.

Public Members

BilinearOptions options

The options used to configure this module.

Tensor weight

The learned weight.

Tensor bias

The learned bias.

If with_bias is false in the options, this tensor is undefined.

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