From f759dda3a971b35f24d09283ab9d5199ed09a958 Mon Sep 17 00:00:00 2001 From: xiao_yao1994 Date: Tue, 30 Apr 2024 16:50:36 +0800 Subject: [PATCH] fix tril strategy length --- mindspore/ccsrc/frontend/parallel/ops_info/tril_info.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mindspore/ccsrc/frontend/parallel/ops_info/tril_info.cc b/mindspore/ccsrc/frontend/parallel/ops_info/tril_info.cc index 18e00146182e..6ecb8e2c1e16 100644 --- a/mindspore/ccsrc/frontend/parallel/ops_info/tril_info.cc +++ b/mindspore/ccsrc/frontend/parallel/ops_info/tril_info.cc @@ -37,8 +37,9 @@ Status TrilInfo::CheckStrategy(const StrategyPtr &strategy) { Strategies strategies = strategy->GetInputDim(); auto stra_value = strategies.at(0); constexpr size_t smallest_stra_len = 2; - if (stra_value.size() < smallest_stra_len) { - MS_LOG(ERROR) << name_ << ": The strategy value size must be greater than 2" + constexpr size_t max_stra_len = 6; + if (stra_value.size() < smallest_stra_len || stra_value.size() > max_stra_len) { + MS_LOG(ERROR) << name_ << ": The strategy value size must be greater than 2 and less than 7" << ", but got strategie value size is " << stra_value.size(); return FAILED; } -- Gitee