Template Class ExpandingArray#
Defined inFile expanding_array.h
Class Documentation#
- template<size_tD,typenameT=int64_t>
classExpandingArray# A utility class that accepts either a container of
D-many values, or a single value, which is internally repeatedDtimes.This is useful to represent parameters that are multidimensional, but often equally sized in all dimensions. For example, the kernel size of a 2D convolution has an
xandylength, butxandyare often equal. In such a case you could just pass3to anExpandingArray<2>and it would “expand” to{3,3}.Public Functions
- inlineExpandingArray(std::initializer_list<T>list)#
Constructs an
ExpandingArrayfrom aninitializer_list.The extent of the length is checked against the
ExpandingArray’s extent parameterDat runtime.
- inlineExpandingArray(std::vector<T>vec)#
Constructs an
ExpandingArrayfrom anstd::vector.The extent of the length is checked against the
ExpandingArray’s extent parameterDat runtime.
- inlineExpandingArray(c10::ArrayRef<T>values)#
Constructs an
ExpandingArrayfrom anc10::ArrayRef.The extent of the length is checked against the
ExpandingArray’s extent parameterDat runtime.
- inlineExpandingArray(Tsingle_size)#
Constructs an
ExpandingArrayfrom a single value, which is repeatedDtimes (whereDis the extent parameter of theExpandingArray).
- inlineExpandingArray(conststd::array<T,D>&values)#
Constructs an
ExpandingArrayfrom a correctly sizedstd::array.
- inlinesize_tsize()constnoexcept#
Returns the extent of the
ExpandingArray.
- inlineExpandingArray(std::initializer_list<T>list)#