check bool tensors for watchpoints

This commit is contained in:
Harshvardhan Gupta 2020-12-10 14:15:14 -05:00
parent d0e7ae66a4
commit 4b2e1ea9f7
2 changed files with 6 additions and 2 deletions

View File

@ -87,8 +87,6 @@ void DebugServices::CheckWatchpoints(std::vector<std::string> *name, std::vector
// skip init condition on all the other states
if ((wp.condition.type == INIT) ^ init_dbg_suspend) continue;
if (wp.condition.type != IS_OVERFLOW && tensor_dtype == kNumberTypeBool) continue;
// check change conditions only on step end.
if (wp.change_condition() && !step_end) continue;
@ -168,6 +166,11 @@ void DebugServices::CheckWatchpoints(std::vector<std::string> *name, std::vector
std::make_unique<TensorSummary<double>>(tensor_ptr->data_c(), previous_tensor_ptr, num_elements);
break;
}
case kNumberTypeBool: {
base_summary_ptr =
std::make_unique<TensorSummary<bool>>(tensor_ptr->data_c(), previous_tensor_ptr, num_elements);
break;
}
default:
MS_LOG(INFO) << "Unsupported tensor type";
continue;

View File

@ -280,4 +280,5 @@ template class TensorSummary<int64_t>;
template class TensorSummary<float16>;
template class TensorSummary<float>;
template class TensorSummary<double>;
template class TensorSummary<bool>;
} // namespace mindspore