Shortcuts

Struct LinearOptions

Page Contents

Struct Documentation

struct torch::nn::LinearOptions

Options for the Linear module.

Example:

Linear model(LinearOptions(5, 2).bias(false));

Public Functions

LinearOptions(int64_t in_features, int64_t out_features)
auto in_features(const int64_t &new_in_features) -> decltype(*this)

size of each input sample

auto in_features(int64_t &&new_in_features) -> decltype(*this)
const int64_t &in_features() const noexcept
int64_t &in_features() noexcept
auto out_features(const int64_t &new_out_features) -> decltype(*this)

size of each output sample

auto out_features(int64_t &&new_out_features) -> decltype(*this)
const int64_t &out_features() const noexcept
int64_t &out_features() noexcept
auto bias(const bool &new_bias) -> decltype(*this)

If set to false, the layer will not learn an additive bias. Default: true.

auto bias(bool &&new_bias) -> decltype(*this)
const bool &bias() const noexcept
bool &bias() noexcept

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