Do not issue an error to TensorFlow when MLIR issues a warning

PiperOrigin-RevId: 295883589
Change-Id: Id5959647363e8f894585f185a9e4e1ca07065c35
This commit is contained in:
Mehdi Amini 2020-02-18 20:23:10 -08:00 committed by TensorFlower Gardener
parent 12651b662c
commit 6cb8ec0e31

View File

@ -63,21 +63,21 @@ Status StatusScopedDiagnosticHandler::Combine(Status status) {
}
LogicalResult StatusScopedDiagnosticHandler::handler(Diagnostic* diag) {
#ifndef NDEBUG
// Non-error diagnostic are ignored when VLOG isn't enabled.
if (diag->getSeverity() != DiagnosticSeverity::Error && VLOG_IS_ON(1))
return success();
size_t current_diag_str_size_ = diag_str_.size();
#endif
// Emit the diagnostic and flush the stream.
emitDiagnostic(*diag);
diag_stream_.flush();
#ifndef NDEBUG
// Emit non-errors to VLOG instead of the internal status.
if (diag->getSeverity() != DiagnosticSeverity::Error) {
VLOG(1) << diag_str_.substr(current_diag_str_size_);
diag_str_.resize(current_diag_str_size_);
}
#endif
// Return failure to signal propagation if necessary.
return failure(propagate_);