Shortcuts

Struct HardtanhOptions

Page Contents

Struct Documentation

struct torch::nn::HardtanhOptions

Options for the Hardtanh module.

Example:

Hardtanh model(HardtanhOptions().min_val(-42.42).max_val(0.42).inplace(true));

Public Functions

auto min_val(const double &new_min_val) -> decltype(*this)

minimum value of the linear region range. Default: -1

auto min_val(double &&new_min_val) -> decltype(*this)
const double &min_val() const noexcept
double &min_val() noexcept
auto max_val(const double &new_max_val) -> decltype(*this)

maximum value of the linear region range. Default: 1

auto max_val(double &&new_max_val) -> decltype(*this)
const double &max_val() const noexcept
double &max_val() noexcept
auto inplace(const bool &new_inplace) -> decltype(*this)

can optionally do the operation in-place. Default: False

auto inplace(bool &&new_inplace) -> decltype(*this)
const bool &inplace() const noexcept
bool &inplace() 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