1 /** 2 * Copyright 2020 Huawei Technologies Co., Ltd 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 #ifndef TESTS_UT_TRANSFORM_UT_TRANSFORM_BASE_H_ 17 #define TESTS_UT_TRANSFORM_UT_TRANSFORM_BASE_H_ 18 19 #include <iostream> 20 #include <string> 21 #include <memory> 22 #include <vector> 23 #include "transform/graph_ir/util.h" 24 #include "ir/tensor.h" 25 26 #include "common/common_test.h" 27 #include "pipeline/jit/parse/parse.h" 28 29 #include "graph/tensor.h" 30 #ifdef OPEN_SOURCE 31 #include "ge/client/ge_api.h" 32 #else 33 #include "external/ge/ge_api.h" 34 #endif 35 36 namespace mindspore { 37 namespace transform { 38 std::vector<FuncGraphPtr> getAnfGraph(std::string package, std::string function); 39 void PrintMeTensor(MeTensor* tensor); 40 FuncGraphPtr MakeFuncGraph(const PrimitivePtr prim, unsigned int nparam); 41 MeTensorPtr MakeTensor(const TypePtr& t, std::initializer_list<int64_t> shp); 42 } // namespace transform 43 } // namespace mindspore 44 45 #endif // TESTS_UT_TRANSFORM_UT_TRANSFORM_BASE_H_ 46