MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / Initialize

Method Initialize

tensorflow/core/util/reporter.cc:38–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36}
37
38Status TestReportFile::Initialize() {
39 if (fname_.empty()) {
40 return Status::OK();
41 }
42 string mangled_fname = strings::StrCat(
43 fname_, absl::StrJoin(str_util::Split(test_name_, '/'), "__"));
44 Env* env = Env::Default();
45 if (env->FileExists(mangled_fname).ok()) {
46 return errors::InvalidArgument(
47 "Cannot create TestReportFile, file exists: ", mangled_fname);
48 }
49 TF_RETURN_IF_ERROR(env->NewWritableFile(mangled_fname, &log_file_));
50 TF_RETURN_IF_ERROR(log_file_->Flush());
51
52 closed_ = false;
53 return Status::OK();
54}
55
56TestReporter::TestReporter(const string& fname, const string& test_name)
57 : report_file_(fname, test_name) {

Callers 1

TESTFunction · 0.45

Calls 9

DefaultFunction · 0.85
InvalidArgumentFunction · 0.85
StrCatFunction · 0.50
SplitFunction · 0.50
emptyMethod · 0.45
okMethod · 0.45
FileExistsMethod · 0.45
NewWritableFileMethod · 0.45
FlushMethod · 0.45

Tested by 1

TESTFunction · 0.36