Teach the HLO bisect utility to run a script when testing for a bug

We also remove the Crash BugKind: it was unimplemented and can be trivially
implemented using the script BugKind.

I also made some minor adjustments:

 - Add two CHECKs to ensure that we do not "lose" the bug in
   TrimComputationByOutputs and TrimComputationByInstructions.

 - Fix a typo.

PiperOrigin-RevId: 260181098
This commit is contained in:
Sanjoy Das 2019-07-26 11:29:32 -07:00 committed by TensorFlower Gardener
parent d0181e13c8
commit 65cd482a27
2 changed files with 13 additions and 4 deletions

View File

@ -39,12 +39,17 @@ bool ProtobufEquals(const tensorflow::protobuf::Message& m1,
}
Status DumpProtoToDirectory(const tensorflow::protobuf::Message& message,
const string& directory, const string& file_name) {
const string& directory, const string& file_name,
string* full_path) {
tensorflow::Env* env = tensorflow::Env::Default();
TF_RETURN_IF_ERROR(env->RecursivelyCreateDir(directory));
string safe_file_name = SanitizeFileName(file_name) + ".pb";
const string path = tensorflow::io::JoinPath(directory, safe_file_name);
return tensorflow::WriteBinaryProto(env, path, message);
string full_path_impl;
if (!full_path) {
full_path = &full_path_impl;
}
*full_path = tensorflow::io::JoinPath(directory, safe_file_name);
return tensorflow::WriteBinaryProto(env, *full_path, message);
}
} // namespace protobuf_util

View File

@ -37,8 +37,12 @@ extern bool ProtobufEquals(const tensorflow::protobuf::Message& m1,
// 'directory/file_name.pb'. The 'directory' is recursively created if it
// doesn't already exist, and the 'file_name' is sanitized by replacing
// illegal characters with underscore '_'.
//
// If 'full_name' is not null then it is set to the name of the file the
// protobuf was written to.
Status DumpProtoToDirectory(const tensorflow::protobuf::Message& message,
const string& directory, const string& file_name);
const string& directory, const string& file_name,
string* full_path = nullptr);
// Registers a function that may either expand a dirpath or forward the original
// dirpath along as-is.