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 #include <iostream> 17 #include <memory> 18 #include <vector> 19 20 #include "ir/value.h" 21 #include "ir/manager.h" 22 #include "common/common_test.h" 23 #include "frontend/optimizer/ad/dfunctor.h" 24 #include "debug/draw.h" 25 #include "common/py_func_graph_fetcher.h" 26 27 namespace mindspore { 28 namespace prim { 29 class TestGradImplementations : public UT::Common { 30 public: 31 TestGradImplementations() {} 32 virtual void SetUp() {} 33 }; 34 35 TEST_F(TestGradImplementations, TestGetAugmentedGraph) { 36 FuncGraphPtr fg = ad::g_k_prims.KPrimitive(nullptr, NewValueNode(kPrimScalarMul), nullptr); 37 ASSERT_TRUE(fg != nullptr); 38 39 auto fg1 = ad::g_k_prims.KPrimitive(nullptr, NewValueNode(kPrimScalarMul), nullptr); 40 41 FuncGraphPairMapEquiv equiv_graph; 42 NodeMapEquiv equiv_node; 43 ASSERT_TRUE(Isomorphic(fg, fg1, &equiv_graph, &equiv_node)); 44 } 45 46 } // namespace prim 47 } // namespace mindspore 48