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

Function BuildSimpleGraph

tensorflow/cc/training/queue_runner_test.cc:69–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67constexpr char kVarOpName[] = "var";
68
69GraphDef BuildSimpleGraph() {
70 Scope root = Scope::NewRootScope();
71 auto init_value = Const(root, 0);
72 auto var = Variable(root.WithOpName(kVarOpName), TensorShape({}),
73 DataType::DT_INT32);
74 auto assign = Assign(root.WithOpName(kAssignOpName), var, init_value);
75 auto count = CountUpTo(root.WithOpName(kCountUpToOpName), var, 10);
76 Square(root.WithOpName(kSquareOpName), var); // NOLINT
77
78 GraphDef graph_def;
79 TF_EXPECT_OK(root.ToGraphDef(&graph_def));
80 return graph_def;
81}
82
83QueueRunnerDef BuildQueueRunnerDef(
84 const std::string& queue_name, const std::vector<std::string>& enqueue_ops,

Callers 2

TEST_FFunction · 0.85
TESTFunction · 0.85

Calls 7

WithOpNameMethod · 0.80
ConstFunction · 0.50
VariableClass · 0.50
TensorShapeClass · 0.50
AssignFunction · 0.50
SquareFunction · 0.50
ToGraphDefMethod · 0.45

Tested by

no test coverage detected