/** * \file dnn/test/common/deduce_layout_proxy.h * MegEngine is Licensed under the Apache License, Version 2.0 (the "License") * * Copyright (c) 2014-2021 Megvii Inc. All rights reserved. * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ #pragma once #include "megdnn/basic_types.h" #include "test/common/utils.h" namespace megdnn { namespace test { template struct DeduceLayoutProxy; template struct DeduceLayoutProxy { static void deduce_layout(Opr*, TensorLayoutArray&) {} }; template struct DeduceLayoutProxy { static void deduce_layout(Opr* opr, TensorLayoutArray& layouts) { megdnn_assert(layouts.size() == 2); opr->deduce_layout(layouts[0], layouts[1]); } }; template struct DeduceLayoutProxy { static void deduce_layout(Opr* opr, TensorLayoutArray& layouts) { megdnn_assert(layouts.size() == 3); opr->deduce_layout(layouts[0], layouts[1], layouts[2]); } }; template struct DeduceLayoutProxy { static void deduce_layout(Opr* opr, TensorLayoutArray& layouts) { megdnn_assert(layouts.size() == 4); opr->deduce_layout(layouts[0], layouts[1], layouts[2], layouts[3]); } }; template struct DeduceLayoutProxy { static void deduce_layout(Opr* opr, TensorLayoutArray& layouts) { megdnn_assert(layouts.size() == 5); opr->deduce_layout(layouts[0], layouts[1], layouts[2], layouts[3], layouts[4]); } }; template struct DeduceLayoutProxy { static void deduce_layout(Opr* opr, TensorLayoutArray& layouts) { megdnn_assert(layouts.size() == 6); opr->deduce_layout( layouts[0], layouts[1], layouts[2], layouts[3], layouts[4], layouts[5]); } }; template struct DeduceLayoutProxy { static void deduce_layout(Opr*, TensorLayoutArray&) {} }; template struct DeduceLayoutProxy { static void deduce_layout(Opr*, TensorLayoutArray&) {} }; template struct DeduceLayoutProxy { static void deduce_layout(Opr*, TensorLayoutArray&) {} }; template struct DeduceLayoutProxy { static void deduce_layout(Opr* opr, TensorLayoutArray& layouts) { megdnn_assert(layouts.size() == 7); opr->deduce_layout( layouts[0], layouts[1], layouts[2], layouts[3], layouts[4], layouts[5], layouts[6]); } }; template struct DeduceLayoutProxy { static void deduce_layout(Opr* opr, TensorLayoutArray& layouts) { megdnn_assert(layouts.size() == 8); opr->deduce_layout( layouts[0], layouts[1], layouts[2], layouts[3], layouts[4], layouts[5], layouts[6], layouts[7]); } }; template struct DeduceLayoutProxy { static void deduce_layout(Opr* opr, TensorLayoutArray& layouts) { megdnn_assert(layouts.size() == 9); opr->deduce_layout( layouts[0], layouts[1], layouts[2], layouts[3], layouts[4], layouts[5], layouts[6], layouts[7], layouts[8]); } }; template struct DeduceLayoutProxy { static void deduce_layout(Opr* opr, TensorLayoutArray& layouts) { megdnn_assert(layouts.size() == 10); opr->deduce_layout( layouts[0], layouts[1], layouts[2], layouts[3], layouts[4], layouts[5], layouts[6], layouts[7], layouts[8], layouts[9]); } }; template struct DeduceLayoutProxy { static void deduce_layout(Opr*, TensorLayoutArray&) {} }; template struct DeduceLayoutProxy { static void deduce_layout(Opr* opr, TensorLayoutArray& layouts) { megdnn_assert(layouts.size() == 13); opr->deduce_layout( layouts[0], layouts[1], layouts[2], layouts[3], layouts[4], layouts[5], layouts[6], layouts[7], layouts[8], layouts[9], layouts[10], layouts[11], layouts[12]); } }; template struct DeduceLayoutProxy { static void deduce_layout(Opr*, TensorLayoutArray&) {} }; } // namespace test } // namespace megdnn // vim: syntax=cpp.doxygen