Template Class ExpandingArrayWithOptionalElem#
Defined in File expanding_array.h
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 repeatedDtimes.It has the additional ability to accept containers of the underlying type
Tand convert them to a container ofstd::optional<T>.Public Functions
-
inline ExpandingArrayWithOptionalElem(std::initializer_list<T> list)#
Constructs an
ExpandingArrayWithOptionalElemfrom aninitializer_listof the underlying typeT.The extent of the length is checked against the
ExpandingArrayWithOptionalElem’s extent parameterDat runtime.
-
inline ExpandingArrayWithOptionalElem(std::vector<T> vec)#
Constructs an
ExpandingArrayWithOptionalElemfrom anstd::vectorof the underlying typeT.The extent of the length is checked against the
ExpandingArrayWithOptionalElem’s extent parameterDat runtime.
-
inline ExpandingArrayWithOptionalElem(c10::ArrayRef<T> values)#
Constructs an
ExpandingArrayWithOptionalElemfrom anc10::ArrayRefof the underlying typeT.The extent of the length is checked against the
ExpandingArrayWithOptionalElem’s extent parameterDat runtime.
-
inline ExpandingArrayWithOptionalElem(T single_size)#
Constructs an
ExpandingArrayWithOptionalElemfrom a single value of the underlying typeT, which is repeatedDtimes (whereDis the extent parameter of theExpandingArrayWithOptionalElem).
-
inline ExpandingArrayWithOptionalElem(const std::array<T, D> &values)#
Constructs an
ExpandingArrayWithOptionalElemfrom a correctly sizedstd::arrayof the underlying typeT.
-
inline ExpandingArrayWithOptionalElem(std::initializer_list<T> list)#