// ${generated_comment} // Generated by tools/jit/gen_unboxing.py. This file declares code generated boxed C++ functions for operators, // base off of native_functions.yaml (or similar yaml file with the same syntax). The definition of such a boxed // function will pop out IValues from the stack then convert them into the correct C++ types based on given schema. This // unboxing logic is an alternative to template-based metaprogramming unboxing. #pragma once #include namespace at { namespace unboxing { namespace { template std::array as_array(const c10::List& list) { std::array res; AT_ASSERT(list.size() == N); std::vector vec; for (c10::IValue elem : list) { vec.push_back(elem.to()); } std::copy(vec.begin(), vec.end(), res.begin()); return res; } } // namespace using Stack = std::vector; // Generated function declaration ${declarations} } // namespace unboxing } // namespace at