Shortcuts

Struct LinearOptions

Page Contents

Struct Documentation

struct 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)
inline auto in_features(const int64_t &new_in_features) -> decltype(*this)

size of each input sample

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

size of each output sample

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

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

inline auto bias(bool &&new_bias) -> decltype(*this)
inline const bool &bias() const noexcept
inline 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