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

Method SetUp

tensorflow/core/grappler/inputs/utils_test.cc:29–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27 string BaseDir() { return io::JoinPath(testing::TmpDir(), "base_dir"); }
28
29 void SetUp() override {
30 TF_CHECK_OK(env_->CreateDir(BaseDir()));
31 non_existent_file_ = io::JoinPath(BaseDir(), "non_existent_file.txt");
32 actual_file_ = io::JoinPath(BaseDir(), "test_file.txt");
33 TF_CHECK_OK(WriteStringToFile(env_, actual_file_, "Some test data"));
34
35 text_graph_def_file_ = io::JoinPath(BaseDir(), "text_graph_def_file.txt");
36 binary_graph_def_file_ =
37 io::JoinPath(BaseDir(), "binary_graph_def_file.txt");
38 text_meta_graph_def_file_ =
39 io::JoinPath(BaseDir(), "text_meta_graph_def_file.txt");
40 binary_meta_graph_def_file_ =
41 io::JoinPath(BaseDir(), "binary_meta_graph_def_file.txt");
42
43 auto node = graph_def_.add_node();
44 node->set_name("foo");
45 node->set_op("bar");
46 TF_CHECK_OK(WriteTextProto(env_, text_graph_def_file_, graph_def_));
47 TF_CHECK_OK(WriteBinaryProto(env_, binary_graph_def_file_, graph_def_));
48 *meta_graph_def_.mutable_graph_def() = graph_def_;
49 TF_CHECK_OK(
50 WriteTextProto(env_, text_meta_graph_def_file_, meta_graph_def_));
51 TF_CHECK_OK(
52 WriteBinaryProto(env_, binary_meta_graph_def_file_, meta_graph_def_));
53 }
54
55 void TearDown() override {
56 int64 undeleted_files, undeleted_dirs;

Callers

nothing calls this directly

Calls 8

BaseDirFunction · 0.85
WriteStringToFileFunction · 0.85
WriteTextProtoFunction · 0.85
WriteBinaryProtoFunction · 0.85
set_opMethod · 0.80
JoinPathFunction · 0.50
CreateDirMethod · 0.45
set_nameMethod · 0.45

Tested by

no test coverage detected