力争自助餐队代码评注 #11

Open
zyf1234 wants to merge 72 commits from zyf1234/mindspore2022:master into master
1 changed files with 32 additions and 0 deletions
Showing only changes of commit 5324ac9b68 - Show all commits

View File

@ -0,0 +1,32 @@
/**
* Copyright 2022-2022 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/cluster_ops_declare.h"
namespace mindspore::transform {
// KMeansCentroids
INPUT_MAP(KMeansCentroids) = {
{1, INPUT_DESC(x)}, {2, INPUT_DESC(y)}, {3, INPUT_DESC(sum_square_y)}, {4, INPUT_DESC(sum_square_x)}};
//输入映射x索引为1y索引为2sum_square_y索引为3sum_square_x索引为4
ATTR_MAP(KMeansCentroids) = {
{"use_actual_distance", ATTR_DESC(use_actual_distance, AnyTraits<bool>(), AnyTraits<bool>())}};
//属性映射属性use_actual_distance类型为bool
OUTPUT_MAP(KMeansCentroids) = {
{0, OUTPUT_DESC(segment_sum)}, {1, OUTPUT_DESC(segment_count)}, {2, OUTPUT_DESC(kmean_total_sum)}};
//输出映射segment_sum索引为0segment_count索引为1kmean_total_sum索引为2
REG_ADPT_DESC(KMeansCentroids, prim::kPrimKMeansCentroids->name(), ADPT_DESC(KMeansCentroids))
//注册KMeansCentroids操作的适配器描述kPrimKMeansCentroids预设的name变量
} // namespace mindspore::transform