Modify snapshot graph dump to use hex filename for consistency with fingerprint folder names
PiperOrigin-RevId: 280327937 Change-Id: I13081cce921f6c668a163770ca9409a4e4848120
This commit is contained in:
parent
9b94c27ef6
commit
213305f75c
@ -262,9 +262,11 @@ Status ReadMetadataFile(const string& hash_dir,
|
|||||||
Status DumpDatasetGraph(const std::string& path, uint64 hash,
|
Status DumpDatasetGraph(const std::string& path, uint64 hash,
|
||||||
const GraphDef& graph) {
|
const GraphDef& graph) {
|
||||||
std::unique_ptr<WritableFile> file;
|
std::unique_ptr<WritableFile> file;
|
||||||
std::string graph_file = absl::StrCat(path, "/graph-", hash, ".pbtxt");
|
std::string hash_hex =
|
||||||
|
strings::StrCat(strings::Hex(hash, strings::kZeroPad16));
|
||||||
|
std::string graph_file = absl::StrCat(path, "/", hash_hex, "-graph.pbtxt");
|
||||||
|
|
||||||
LOG(INFO) << "Graph hash is " << hash << ", writing to " << graph_file;
|
LOG(INFO) << "Graph hash is " << hash_hex << ", writing to " << graph_file;
|
||||||
TF_RETURN_IF_ERROR(Env::Default()->RecursivelyCreateDir(path));
|
TF_RETURN_IF_ERROR(Env::Default()->RecursivelyCreateDir(path));
|
||||||
return WriteTextProto(Env::Default(), graph_file, graph);
|
return WriteTextProto(Env::Default(), graph_file, graph);
|
||||||
}
|
}
|
||||||
|
@ -62,7 +62,7 @@ class SnapshotDatasetTest(reader_dataset_ops_test_base.TFRecordDatasetTestBase,
|
|||||||
|
|
||||||
# Ignore the graphdef pbtxts we write for debugging purposes.
|
# Ignore the graphdef pbtxts we write for debugging purposes.
|
||||||
for i in range(len(dirlist_raw)):
|
for i in range(len(dirlist_raw)):
|
||||||
if not dirlist_raw[i].startswith("graph-"):
|
if not dirlist_raw[i].endswith("-graph.pbtxt"):
|
||||||
dirlist.append(dirlist_raw[i])
|
dirlist.append(dirlist_raw[i])
|
||||||
|
|
||||||
self.assertLen(dirlist, num_fingerprints)
|
self.assertLen(dirlist, num_fingerprints)
|
||||||
|
Loading…
Reference in New Issue
Block a user