Class BilinearImpl¶
Defined in File linear.h
Page Contents
Inheritance Relationships¶
Base Type¶
public torch::nn::Cloneable< BilinearImpl >
(Template Class Cloneable)
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 givenstream
.
-
Tensor forward(const Tensor &input1, const Tensor &input2)¶
Applies a bilinear transform on the
input1
andinput2
tensor by multiplying with theweight
and optionally adding thebias
, ifwith_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 theoptions
, this tensor is undefined.
-
inline BilinearImpl(int64_t in1_features, int64_t in2_features, int64_t out_features)¶