Template Class ExpandingArrayWithOptionalElem¶
Defined in File expanding_array.h
Page Contents
Inheritance Relationships¶
Base Type¶
public torch::ExpandingArray< D, std::optional< int64_t > >
(Template Class ExpandingArray)
Class Documentation¶
-
template<size_t D, typename T = int64_t>
class ExpandingArrayWithOptionalElem : public torch::ExpandingArray<D, std::optional<int64_t>>¶ A utility class that accepts either a container of
D
-manystd::optional<T>
values, or a singlestd::optional<T>
value, which is internally repeatedD
times.It has the additional ability to accept containers of the underlying type
T
and convert them to a container ofstd::optional<T>
.Public Functions
-
inline ExpandingArrayWithOptionalElem(std::initializer_list<T> list)¶
Constructs an
ExpandingArrayWithOptionalElem
from aninitializer_list
of the underlying typeT
.The extent of the length is checked against the
ExpandingArrayWithOptionalElem
’s extent parameterD
at runtime.
-
inline ExpandingArrayWithOptionalElem(std::vector<T> vec)¶
Constructs an
ExpandingArrayWithOptionalElem
from anstd::vector
of the underlying typeT
.The extent of the length is checked against the
ExpandingArrayWithOptionalElem
’s extent parameterD
at runtime.
-
inline ExpandingArrayWithOptionalElem(c10::ArrayRef<T> values)¶
Constructs an
ExpandingArrayWithOptionalElem
from anc10::ArrayRef
of the underlying typeT
.The extent of the length is checked against the
ExpandingArrayWithOptionalElem
’s extent parameterD
at runtime.
-
inline ExpandingArrayWithOptionalElem(T single_size)¶
Constructs an
ExpandingArrayWithOptionalElem
from a single value of the underlying typeT
, which is repeatedD
times (whereD
is the extent parameter of theExpandingArrayWithOptionalElem
).
-
inline ExpandingArrayWithOptionalElem(const std::array<T, D> &values)¶
Constructs an
ExpandingArrayWithOptionalElem
from a correctly sizedstd::array
of the underlying typeT
.
-
inline ExpandingArrayWithOptionalElem(std::initializer_list<T> list)¶