1 /**
2 * Copyright 2021-2023 Huawei Technologies Co., Ltd
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License", true);
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
17 #include "abstract/ops/infer_functions.h"
18 #include "abstract/ops/primitive_infer_map.h"
19 #include "mindspore/core/ops/array_ops.h"
20 #include "mindspore/core/ops/conv_pool_ops.h"
21 #include "mindspore/core/ops/framework_ops.h"
22 #include "mindspore/core/ops/image_ops.h"
23 #include "mindspore/core/ops/math_ops.h"
24 #include "mindspore/core/ops/nn_ops.h"
25 #include "mindspore/core/ops/nn_optimizer_ops.h"
26 #include "mindspore/core/ops/other_ops.h"
27 #include "mindspore/core/ops/sequence_ops.h"
28 #include "mindspore/core/ops/sparse_tensor_ops.h"
29 #include "mindspore/core/ops/structure_ops.h"
30 namespace mindspore {
31 namespace abstract {
32 // using R = PrimitiveEvalImplMap::mapped_type;
33 static PrimitiveEvalImplMap deprecated_infer_map{
34 // deprecated infer functions, new implement please refer to op_infer.h
35 };
GetDeprecatedPrimitiveInferMapPtr()36 PrimitiveEvalImplMap *GetDeprecatedPrimitiveInferMapPtr() { return &deprecated_infer_map; }
GetDeprecatedPrimitiveInferMap()37 const PrimitiveEvalImplMap &GetDeprecatedPrimitiveInferMap() { return deprecated_infer_map; }
38 REG_PRIM_INFER_FUNC(Return, true)
39 REG_PRIM_INFER_FUNC(Switch, true)
40 REG_PRIM_INFER_FUNC(SwitchLayer, true)
41 REG_PRIM_INFER_FUNC(Is_, true)
42 REG_PRIM_INFER_FUNC(IsNot, true)
43 REG_PRIM_INFER_FUNC(InDict, true)
44 REG_PRIM_INFER_FUNC(NotInDict, true)
45 REG_PRIM_INFER_FUNC(IsConstant, true)
46 // REG_PRIM_INFER_FUNC(BiasAddGrad, true)
47 REG_PRIM_INFER_FUNC(BpropCut, true)
48 // REG_PRIM_INFER_FUNC(Sqrt, true)
49 // REG_PRIM_INFER_FUNC(SqrtGrad, true)
50 REG_PRIM_INFER_FUNC(ArrayToScalar, true)
51 REG_PRIM_INFER_FUNC(BroadcastShape, true)
52 REG_PRIM_INFER_FUNC(identity, true)
53 REG_PRIM_INFER_FUNC(MakeDict, true)
54 // REG_PRIM_INFER_FUNC(UnsortedSegmentSum, true)
55 REG_PRIM_INFER_FUNC(MakeKeywordArg, true)
56 REG_PRIM_INFER_FUNC(ExtractKeywordArg, true)
57 REG_PRIM_INFER_FUNC(DictGetItem, true)
58 REG_PRIM_INFER_FUNC(DictSetItem, true)
59 REG_PRIM_INFER_FUNC(DictGetKeys, true)
60 REG_PRIM_INFER_FUNC(DictGetValues, true)
61 REG_PRIM_INFER_FUNC(DictItems, true)
62 REG_PRIM_INFER_FUNC(Mutable, true)
63 REG_PRIM_INFER_FUNC(GetGrad, true)
64 REG_PRIM_INFER_FUNC(EnvironAdd, true)
65 REG_PRIM_INFER_FUNC(StateSetItem, true)
66 REG_PRIM_INFER_FUNC(Depend, true)
67 REG_PRIM_INFER_FUNC(UpdateState, true)
68 REG_PRIM_INFER_FUNC(Debug, true)
69 REG_PRIM_INFER_FUNC(MakeRowTensor, true)
70 REG_PRIM_INFER_FUNC(RowTensorGetValues, true)
71 REG_PRIM_INFER_FUNC(RowTensorGetIndices, true)
72 REG_PRIM_INFER_FUNC(RowTensorGetDenseShape, true)
73 REG_PRIM_INFER_FUNC(RowTensorAdd, true)
74 // REG_PRIM_INFER_FUNC(Div, true)
75 REG_PRIM_INFER_FUNC(SubAndFilter, true)
76 REG_PRIM_INFER_FUNC(MapCacheIdx, true)
77 REG_PRIM_INFER_FUNC(CacheSwapTable, true)
78 REG_PRIM_INFER_FUNC(SparseApplyProximalAdagrad, true)
79 // REG_PRIM_INFER_FUNC(AllReduce, true)
80 // REG_PRIM_INFER_FUNC(Broadcast, true)
81 // REG_PRIM_INFER_FUNC(AllGather, true)
82 // REG_PRIM_INFER_FUNC(ReduceScatter, true)
83 // REG_PRIM_INFER_FUNC(SGD, true)
84 // REG_PRIM_INFER_FUNC(Transpose, true)
85 // REG_PRIM_INFER_FUNC(Cast, true)
86 // REG_PRIM_INFER_FUNC(Minimum, true)
87 // REG_PRIM_INFER_FUNC(DivNoNan, true)
88 // REG_PRIM_INFER_FUNC(LinSpace, true)
89 REG_PRIM_INFER_FUNC(IsDimUnknown, true)
90 REG_PRIM_INFER_FUNC(IsShapeUnknown, true)
91 REG_PRIM_INFER_FUNC(IsElementUnknown, true)
92 REG_PRIM_INFER_FUNC(IsTensorBoolCond, true)
93 // REG_PRIM_INFER_FUNC(Pad, true)
94 REG_PRIM_INFER_FUNC(MapUniform, true)
95 REG_PRIM_INFER_FUNC(SequenceMask, true)
96 REG_PRIM_INFER_FUNC(FlattenConcat, true)
97 REG_PRIM_INFER_FUNC(Load, true)
98 // REG_PRIM_INFER_FUNC(TransData, true)
99 // REG_PRIM_INFER_FUNC(TensorMove, true)
100 REG_PRIM_INFER_FUNC(RealInner, true)
101 // REG_PRIM_INFER_FUNC(AdamApplyOne, true)
102 // REG_PRIM_INFER_FUNC(AdamApplyOneWithDecay, true)
103 } // namespace abstract
104 } // namespace mindspore
105