#if !defined(TORCH_STABLE_ONLY) && !defined(TORCH_TARGET_VERSION) #pragma once #include #include namespace c10 { // Pack a parameter pack of std::vector rvalues into a // std::vector> without copying each inner vector. // std::vector{a, b} copies: the initializer_list backing array is const, // so the vector's init-list ctor can only copy out of it. template std::vector> make_nested(std::vector&& head, Vs&&... tail) { std::vector> out; out.reserve(1 + sizeof...(Vs)); out.emplace_back(std::move(head)); ((out.emplace_back(std::forward(tail))), ...); return out; } } // namespace c10 #else #error "This file should not be included when either TORCH_STABLE_ONLY or TORCH_TARGET_VERSION is defined." #endif // !defined(TORCH_STABLE_ONLY) && !defined(TORCH_TARGET_VERSION)