From 9dc45c6663ab2da09ff714bf60eec3120313947c Mon Sep 17 00:00:00 2001 From: Dengrx Date: Sun, 27 Aug 2023 14:57:17 +0800 Subject: [PATCH] ADD file via upload --- state_ops_declare.cc | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 state_ops_declare.cc diff --git a/state_ops_declare.cc b/state_ops_declare.cc new file mode 100644 index 0000000..8e77f0e --- /dev/null +++ b/state_ops_declare.cc @@ -0,0 +1,25 @@ +/** + * Copyright 2019 Huawei Technologies Co., Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "transform/graph_ir/op_declare/state_ops_declare.h" +//"Variable" 运算符通常用于表示模型中的变量(例如权重和偏置项) +namespace mindspore::transform { +// Variable +INPUT_MAP(Variable) = {{1, INPUT_DESC(x)}}; +// 定义 "Variable" 运算符的输入映射(INPUT_MAP),将输入1映射为名为 "x" 的输入描述(INPUT_DESC) +ATTR_MAP(Variable) = EMPTY_ATTR_MAP; +// 定义 "Variable" 运算符的属性映射(ATTR_MAP),此处为空(EMPTY_ATTR_MAP) +} // namespace mindspore::transform