Browse Source

redistribution_support_all_repeat_cal_when_dev_matrix_diff

tags/v1.1.0
yao_yf 5 years ago
parent
commit
3342ebfb5f
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      mindspore/ccsrc/frontend/parallel/tensor_layout/redistribution_layout_transfer.cc

+ 5
- 1
mindspore/ccsrc/frontend/parallel/tensor_layout/redistribution_layout_transfer.cc View File

@@ -25,7 +25,11 @@ Status RedistributionLayoutTransfer::CheckValidTransfer() {
Shape from_shape = from_in_.tensor_shape().array();
if (std::find(from_shape.begin(), from_shape.end(), -1) != from_shape.end()) {
is_dynamic_shape_ = true;
if (from_in_ != to_in_) {
bool not_all_repeat = std::any_of(from_in_.tensor_map().array().begin(), from_in_.tensor_map().array().end(),
[](int64_t i) { return i != -1; }) ||
std::any_of(to_in_.tensor_map().array().begin(), to_in_.tensor_map().array().end(),
[](int64_t i) { return i != -1; });
if (from_in_ != to_in_ && not_all_repeat) {
MS_LOG(ERROR) << "In dynamic shape scene, the from_tensor_shape should be equal to to_tensor_shape";
MS_LOG(ERROR) << "from_in layout" << from_in_.ToString();
MS_LOG(ERROR) << "to_in layout" << to_in_.ToString();


Loading…
Cancel
Save