Shortcuts

Template Class ExpandingArrayWithOptionalElem

Inheritance Relationships

Base Type

Class Documentation

template<size_t D, typename T = int64_t>
class ExpandingArrayWithOptionalElem : public torch::ExpandingArray<D, c10::optional<int64_t>>

A utility class that accepts either a container of D-many c10::optional<T> values, or a single c10::optional<T> value, which is internally repeated D times.

It has the additional ability to accept containers of the underlying type T and convert them to a container of c10::optional<T>.

Public Functions

inline ExpandingArrayWithOptionalElem(std::initializer_list<T> list)

Constructs an ExpandingArrayWithOptionalElem from an initializer_list of the underlying type T.

The extent of the length is checked against the ExpandingArrayWithOptionalElem’s extent parameter D at runtime.

inline ExpandingArrayWithOptionalElem(std::vector<T> vec)

Constructs an ExpandingArrayWithOptionalElem from an std::vector of the underlying type T.

The extent of the length is checked against the ExpandingArrayWithOptionalElem’s extent parameter D at runtime.

inline ExpandingArrayWithOptionalElem(at::ArrayRef<T> values)

Constructs an ExpandingArrayWithOptionalElem from an at::ArrayRef of the underlying type T.

The extent of the length is checked against the ExpandingArrayWithOptionalElem’s extent parameter D at runtime.

inline ExpandingArrayWithOptionalElem(T single_size)

Constructs an ExpandingArrayWithOptionalElem from a single value of the underlying type T, which is repeated D times (where D is the extent parameter of the ExpandingArrayWithOptionalElem).

inline ExpandingArrayWithOptionalElem(const std::array<T, D> &values)

Constructs an ExpandingArrayWithOptionalElem from a correctly sized std::array of the underlying type T.

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