Shortcuts

Struct FlattenOptions

Page Contents

Struct Documentation

struct torch::nn::FlattenOptions

Options for the Flatten module.

Example:

Flatten model(FlattenOptions().start_dim(2).end_dim(4));

Public Functions

auto start_dim(const int64_t &new_start_dim) -> decltype(*this)

first dim to flatten

auto start_dim(int64_t &&new_start_dim) -> decltype(*this)
const int64_t &start_dim() const noexcept
int64_t &start_dim() noexcept
auto end_dim(const int64_t &new_end_dim) -> decltype(*this)

last dim to flatten

auto end_dim(int64_t &&new_end_dim) -> decltype(*this)
const int64_t &end_dim() const noexcept
int64_t &end_dim() 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