文件最后提交记录最后更新时间
优化多个文件中的代码风格 Co-authored-by: yuantao<taoyuan18@huawei.com> Co-authored-by: init__zhb__<zhanghaobo6@huawei.com> # message auto-generated for no-merge-commit merge: !1295 merge clean into master 优化多个文件中的代码风格 Created-by: yuantao_ Commit-by: init__zhb__;yuantao Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> 多个文件中的代码风格可以进行改进: | 文件路径 | 代码片段 | 问题描述 | 行号 | | ---------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------- | --- | | conversion/concat_d/op_api/concat_d.cpp | if (tail_dim * type_size[promoteType] % 32 != 0) { | 避免魔法数字 (32) | 54 | | conversion/depth_to_space/examples/test_geir_depth_to_space.cpp | add1.update_output_desc_##outputName(outputName##outputIndex##_desc); | 宏定义无需分号 | 68 | | conversion/depth_to_space/examples/test_geir_depth_to_space.cpp | inputs.push_back(placeholder##intputIndex); | 宏定义无需分号 | 60 | | conversion/depth_to_space/examples/test_geir_depth_to_space.cpp | char *endptr; | 使用std::string替代char* | 202 | | conversion/strided_slice_grad/examples/test_geir_strided_slice_grad.cpp | pData[i] = value + (i % 3) * 0.4f; // 让数据更有意义 | 避免魔法数字 (3) | 126 | | conversion/strided_slice_grad/examples/test_geir_strided_slice_grad.cpp | return 2; | 避免魔法数字 (2) | 109 | | conversion/strided_slice_grad/examples/test_geir_strided_slice_grad.cpp | return 4; | 避免魔法数字 (4) | 107 | | conversion/concat_d/op_api/concat_d.cpp | if (inputs->Size() > 512 \|\| inputs->Size() < 33) { | 避免魔法数字 (512) | 45 | | conversion/concat_d/op_api/concat_d.cpp | catMaxInputSize = 512; | 避免魔法数字 (512) | 92 | | conversion/depth_to_space/examples/test_geir_depth_to_space.cpp | FILE *fp; | 变量应在使用时声明初始化 | 153 | | conversion/depth_to_space/examples/test_geir_depth_to_space.cpp | add1.set_attr_##attrName(attrValue); | 宏定义无需分号 | 63 | | random/dsa_random_uniform/op_host/op_api/aclnn_multinomial.cpp | auto randomUniform = GetRandomUniformNoReplaceMent(selfContiguous, randomParams, uniqueExecutor.get()); | 数组参数应传递长度 (randomParams) | 377 | | conversion/squeezev2/op_host/squeezev2_infershape.cpp | return SqueezeWithAxes(x_shape, squeeze_dims, y_shape); | 数组参数应传递长度 (squeeze_dims) | 114 | | conversion/concat_dv2/op_host/concat_dv2_tiling.cpp | tiling.set_endTensorIdx(endTensorIdx); | 数组参数应传递长度 (endTensorIdx) | 143 | | conversion/squeezev3/op_host/squeezev3_infershape.cpp | return SqueezeWithAxes(x_shape, squeeze_dims, y_shape); | 数组参数应传递长度 (squeeze_dims) | 117 | | conversion/concat_dv2/op_host/concat_dv2_tiling.cpp | tiling.set_endTensorOffset(endTensorOffset); | 数组参数应传递长度 (endTensorOffset) | 144 | | conversion/squeezev2/op_host/squeezev2_infershape.cpp | if (!IsAxesRangeValid(squeeze_dims, static_cast<int64_t>(x_shape->GetDimNum()), axes)) { | 数组参数应传递长度 (squeeze_dims) | 108 | | random/sim_thread_exponential/op_kernel/sim_thread_exponential.h | AscendC::And(..., mask, len / SHIFT_LEFT_32, { 1, 1, 1, 8, | 数组参数应传递长度 (mask) | 567 | | random/dsa_gen_bit_mask/examples/test_dropout_gen_mask.cpp | std::vector<float> outHostData(8, 0); | 避免魔法数字 (8) | 89 | | conversion/diag_v2/examples/test_geir_diag_v2.cpp | char *endptr; | 使用std::string替代char* | 220 | | random/dsa_gen_bit_mask/examples/test_dropout_gen_mask.cpp | std::vector<uint8_t> maskOutHostData(16, 0); | 避免魔法数字 (16) | 90 | | conversion/diag_v2/examples/test_geir_diag_v2.cpp | FILE *fp; | 变量应在使用时声明初始化 | 177 | | conversion/diag_v2/examples/test_geir_diag_v2.cpp | add1.set_attr_##attrName(attrValue); | 宏定义无需分号 | 63 | | conversion/diag_v2/examples/test_geir_diag_v2.cpp | inputs.push_back(placeholder##intputIndex); | 宏定义无需分号 | 60 | | conversion/diag_v2/examples/test_geir_diag_v2.cpp | add1.update_output_desc_##outputName(outputName##outputIndex##_desc); | 宏定义无需分号 | 92 | | conversion/unfold_grad/op_kernel/unfold_grad_final_axe_big_size.h | _(空行)_ | 代码块末尾不应有空行 | 56 | | random/dsa_gen_bit_mask/examples/test_aclnn_dropout_gen_mask_v2_tensor.cpp | std::vector<uint8_t> outHostData(16, 0); | 避免魔法数字 (16) | 93 | | random/dsa_gen_bit_mask/examples/test_dropout.cpp | std::vector<uint8_t> maskOutHostData(16, 0); | 避免魔法数字 (16) | 90 | | random/dsa_gen_bit_mask/examples/test_dropout.cpp | std::vector<float> outHostData(8, 0); | 避免魔法数字 (8) | 89 | | conversion/concat_dv2/op_host/concat_dv2_def.cpp | 0 | 代码块末尾不应有空行 | 45 | | conversion/concat_d/op_api/aclnn_cat.cpp | catMaxInputs = 512; | 避免魔法数字 (512) | 337 | | conversion/clip_by_value_v2/examples/test_aclnn_clamp_max.cpp | std::vector<int8_t> outHostData(8, 0); | 避免魔法数字 (8) | 80 | | random/dsa_gen_bit_mask/examples/test_dropout_gen_mask_v2.cpp | std::vector<uint8_t> outHostData(16, 0); | 避免魔法数字 (16) | 86 | | conversion/broadcast_to/examples/test_geir_broadcast_to.cpp | inputs.push_back(placeholder##intputIndex); | 宏定义无需分号 | 89 | | random/dsa_gen_bit_mask/examples/test_aclnn_bernoulli.cpp | std::vector<float> outHostData(16, 0); | 避免魔法数字 (16) | 89 | | conversion/confusion_transpose_d/examples/test_aclnn_confusion_transpose.cpp | std::vector<float> outHostData(8, 1); | 避免魔法数字 (8) | 116 | | conversion/clip_by_value_v2/examples/test_aclnn_clamp_max_tensor.cpp | std::vector<double> outHostData(8, 0); | 避免魔法数字 (8) | 82 | ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。--> <!-- 如果这个PR是为了解决特定的问题单,请在这里描述问题单单号。--> ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [x] 其他,请描述:清理代码,优化代码风格。 See merge request: cann/ops-math!12953 个月前
update docs and proto for random_uniform_int_v2 Co-authored-by: 薛靖晖<xuejinghui@huawei.com> # message auto-generated for no-merge-commit merge: !1057 merge master into master update docs and proto for random_uniform_int_v2 Created-by: xuejinghui Commit-by: 薛靖晖 Merged-by: cann-robot Description: ## 描述 更新random_uniform_int_v2算子文档,移除不必要的CMakeLists ## 关联的Issue https://gitcode.com/cann/ops-math/issues/600 <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。--> <!-- 如果这个PR是为了解决特定的问题单,请在这里描述问题单单号。--> ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!10573 个月前
修改random_uniform_int_v2算子include路径解决交叉合入问题 Co-authored-by: 薛靖晖<xuejinghui@huawei.com> # message auto-generated for no-merge-commit merge: !1050 merge master into master 修改random_uniform_int_v2算子include路径解决交叉合入问题 Created-by: xuejinghui Commit-by: 薛靖晖 Merged-by: cann-robot Description: ## 描述 随机数算子重构导致random_tiling_base.h路径移动,造成交叉合入,修改include路径解决问题 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> ## 关联的Issue https://gitcode.com/cann/ops-math/issues/595 <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。--> <!-- 如果这个PR是为了解决特定的问题单,请在这里描述问题单单号。--> ## 测试 本地编译验证 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [x] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!10504 个月前
support RandomUniformIntV2 Co-authored-by: zhaozi3<zhaozi3@h-partners.com> Co-authored-by: haoranqin<qinhaoran8@huawei.com> Co-authored-by: 薛靖晖<xuejinghui@huawei.com> # message auto-generated for no-merge-commit merge: !957 merge master into master support RandomUniformIntV2 Created-by: xuejinghui Commit-by: 薛靖晖;haoranqin;zhaozi3 Merged-by: cann-robot Description: ## 描述 新增RandomUniformIntV2算子,随机生成均匀分布的随机整数 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> ## 关联的Issue https://gitcode.com/cann/ops-math/issues/570 <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。--> <!-- 如果这个PR是为了解决特定的问题单,请在这里描述问题单单号。--> ## 测试 已通过ST测试、门槛用例测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!9574 个月前
fix RandomUniformIntV2Tiling ut Co-authored-by: zhaozi3<zhaozi3@h-partners.com> # message auto-generated for no-merge-commit merge: !1376 merge master into master fix RandomUniformIntV2Tiling ut Created-by: zhaozi3 Commit-by: zhaozi3 Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> fix RandomUniformIntV2Tiling ut ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。--> <!-- 如果这个PR是为了解决特定的问题单,请在这里描述问题单单号。--> ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [x] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!13763 个月前
support RandomUniformIntV2 Co-authored-by: zhaozi3<zhaozi3@h-partners.com> Co-authored-by: haoranqin<qinhaoran8@huawei.com> Co-authored-by: 薛靖晖<xuejinghui@huawei.com> # message auto-generated for no-merge-commit merge: !957 merge master into master support RandomUniformIntV2 Created-by: xuejinghui Commit-by: 薛靖晖;haoranqin;zhaozi3 Merged-by: cann-robot Description: ## 描述 新增RandomUniformIntV2算子,随机生成均匀分布的随机整数 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> ## 关联的Issue https://gitcode.com/cann/ops-math/issues/570 <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。--> <!-- 如果这个PR是为了解决特定的问题单,请在这里描述问题单单号。--> ## 测试 已通过ST测试、门槛用例测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!9574 个月前
support RandomUniformIntV2 Co-authored-by: zhaozi3<zhaozi3@h-partners.com> Co-authored-by: haoranqin<qinhaoran8@huawei.com> Co-authored-by: 薛靖晖<xuejinghui@huawei.com> # message auto-generated for no-merge-commit merge: !957 merge master into master support RandomUniformIntV2 Created-by: xuejinghui Commit-by: 薛靖晖;haoranqin;zhaozi3 Merged-by: cann-robot Description: ## 描述 新增RandomUniformIntV2算子,随机生成均匀分布的随机整数 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> ## 关联的Issue https://gitcode.com/cann/ops-math/issues/570 <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。--> <!-- 如果这个PR是为了解决特定的问题单,请在这里描述问题单单号。--> ## 测试 已通过ST测试、门槛用例测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!9574 个月前
README.md

RandomUniformIntV2

产品支持情况

产品 是否支持
Ascend 950PR/Ascend 950DT
Atlas A3 训练系列产品/Atlas A3 推理系列产品 ×
Atlas A2 训练系列产品/Atlas A2 推理系列产品 ×
Atlas 200I/500 A2 推理产品 ×
Atlas 推理系列产品 ×
Atlas 训练系列产品 ×

功能说明

  • 算子功能:返回均匀分布的随机整数数列。

参数说明

参数名 输入/输出/属性 描述 数据类型 数据格式
shape 输入 输出张量的形状。 INT64、INT32 ND
min 输入 生成的整数的包含下界。 INT64、INT32 ND
max 输入 生成的整数的排除上界。 INT64、INT32 ND
offset 输入 偏移值。 INT64 ND
seed 属性 随机数种子。 INT ND
seed2 属性 随机数种子。 INT ND
y 输出 生成的随机数序列。 INT64、INT32 ND
offset 输出 偏移值。 INT64 ND

约束说明

调用说明

调用方式 样例代码 说明
图模式调用 test_geir_random_uniform_int_v2 通过算子IR构图方式调用RandomUniformIntV2算子。