Home
last modified time | relevance | path

Searched refs:graph (Results 1 – 25 of 1680) sorted by relevance

12345678910>>...68

/external/tensorflow/tensorflow/core/grappler/
Dmutable_graph_view_test.cc36 void CompareNodeFanins(const MutableGraphView& graph, NodeDef* node, in CompareNodeFanins() argument
50 graph.GetOutputPort(tensor_id.node(), tensor_id.index()); in CompareNodeFanins()
51 EXPECT_TRUE(graph.GetFanin(input_port).contains(output_port)); in CompareNodeFanins()
52 EXPECT_TRUE(graph.GetFanout(output_port).contains(input_port)); in CompareNodeFanins()
56 void CompareNodeFanouts(const MutableGraphView& graph, NodeDef* node, in CompareNodeFanouts() argument
59 graph.GetFanouts(*node, /*include_controlled_nodes=*/true); in CompareNodeFanouts()
63 MutableGraphView::InputPort input_port(graph.GetNode(tensor_id.node()), in CompareNodeFanouts()
69 void CheckNode(const MutableGraphView& graph, absl::string_view node_name, in CheckNode() argument
74 NodeDef* node = graph.GetNode(node_name); in CheckNode()
84 CompareNodeFanins(graph, node, fanins); in CheckNode()
[all …]
/external/skqp/tests/
DTopoSortTest.cpp14 typedef void (*CreateGraphPF)(SkTArray<sk_sp<sk_tool_utils::TopoTestNode>>* graph);
23 static void create_graph0(SkTArray<sk_sp<sk_tool_utils::TopoTestNode>>* graph) { in create_graph0() argument
24 sk_tool_utils::TopoTestNode::AllocNodes(graph, 4); in create_graph0()
26 (*graph)[0]->dependsOn((*graph)[1].get()); in create_graph0()
27 (*graph)[0]->dependsOn((*graph)[2].get()); in create_graph0()
28 (*graph)[1]->dependsOn((*graph)[3].get()); in create_graph0()
29 (*graph)[2]->dependsOn((*graph)[3].get()); in create_graph0()
41 static void create_graph1(SkTArray<sk_sp<sk_tool_utils::TopoTestNode>>* graph) { in create_graph1() argument
42 sk_tool_utils::TopoTestNode::AllocNodes(graph, 4); in create_graph1()
44 (*graph)[0]->dependsOn((*graph)[1].get()); in create_graph1()
[all …]
/external/skia/tests/
DTopoSortTest.cpp14 typedef void (*CreateGraphPF)(SkTArray<sk_sp<sk_tool_utils::TopoTestNode>>* graph);
23 static void create_graph0(SkTArray<sk_sp<sk_tool_utils::TopoTestNode>>* graph) { in create_graph0() argument
24 sk_tool_utils::TopoTestNode::AllocNodes(graph, 4); in create_graph0()
26 (*graph)[0]->dependsOn((*graph)[1].get()); in create_graph0()
27 (*graph)[0]->dependsOn((*graph)[2].get()); in create_graph0()
28 (*graph)[1]->dependsOn((*graph)[3].get()); in create_graph0()
29 (*graph)[2]->dependsOn((*graph)[3].get()); in create_graph0()
41 static void create_graph1(SkTArray<sk_sp<sk_tool_utils::TopoTestNode>>* graph) { in create_graph1() argument
42 sk_tool_utils::TopoTestNode::AllocNodes(graph, 4); in create_graph1()
44 (*graph)[0]->dependsOn((*graph)[1].get()); in create_graph1()
[all …]
/external/tensorflow/tensorflow/core/grappler/optimizers/data/
Dgraph_utils_test.cc42 MutableGraphView graph(&graph_def); in TEST() local
43 NodeDef* bool_node = AddScalarConstNode<bool>(true, &graph); in TEST()
44 EXPECT_TRUE(ContainsGraphNodeWithName(bool_node->name(), *graph.graph())); in TEST()
50 MutableGraphView graph(&graph_def); in TEST() local
51 NodeDef* double_node = AddScalarConstNode<double>(3.14, &graph); in TEST()
52 EXPECT_TRUE(ContainsGraphNodeWithName(double_node->name(), *graph.graph())); in TEST()
58 MutableGraphView graph(&graph_def); in TEST() local
59 NodeDef* float_node = AddScalarConstNode<float>(3.14, &graph); in TEST()
60 EXPECT_TRUE(ContainsGraphNodeWithName(float_node->name(), *graph.graph())); in TEST()
66 MutableGraphView graph(&graph_def); in TEST() local
[all …]
Dmap_vectorization_test.cc58 FunctionDef* AddMapFn(MutableGraphView* graph) { in AddMapFn() argument
59 FunctionDef* map_fn = graph->graph()->mutable_library()->add_function(); in AddMapFn()
71 NodeDef* AddMapNode(MutableGraphView* graph, const string& input_dataset, in AddMapNode() argument
76 graph_utils::AddScalarConstNode(num_parallel_calls, graph); in AddMapNode()
101 graph_utils::SetUniqueGraphNodeName(result.name(), graph->graph(), &result); in AddMapNode()
102 return graph->AddNode(std::move(result)); in AddMapNode()
105 NodeDef* AddPrefetchNode(MutableGraphView* graph, const string& input_dataset, in AddPrefetchNode() argument
107 auto buffer_size_node = graph_utils::AddScalarConstNode(buffer_size, graph); in AddPrefetchNode()
115 return graph->AddNode(std::move(result)); in AddPrefetchNode()
118 NodeDef* AddBatchNode(MutableGraphView* graph, const string& input_dataset, in AddBatchNode() argument
[all …]
Dnoop_elimination.cc34 bool IsTakeAll(const NodeDef& take_node, const MutableGraphView& graph) { in IsTakeAll() argument
37 const auto& count_node = *graph.GetNode(take_node.input(1)); in IsTakeAll()
48 bool IsSkipNone(const NodeDef& skip_node, const MutableGraphView& graph) { in IsSkipNone() argument
51 return IsConstNodeWithValue(*graph.GetNode(skip_node.input(1)), 0); in IsSkipNone()
54 bool IsRepeatOne(const NodeDef& repeat_node, const MutableGraphView& graph) { in IsRepeatOne() argument
57 return IsConstNodeWithValue(*graph.GetNode(repeat_node.input(1)), 1); in IsRepeatOne()
61 const MutableGraphView& graph) { in IsPrefetchZero() argument
64 return IsConstNodeWithValue(*graph.GetNode(prefetch_node.input(1)), 0); in IsPrefetchZero()
67 bool IsNoOp(const NodeDef& node, const MutableGraphView& graph) { in IsNoOp() argument
68 return IsTakeAll(node, graph) || IsSkipNone(node, graph) || in IsNoOp()
[all …]
Dgraph_utils.cc44 std::vector<int> CreateNameIndex(const GraphDef& graph) { in CreateNameIndex() argument
46 for (int i = 0; i < graph.node_size(); ++i) { in CreateNameIndex()
47 names[graph.node(i).name()] = i; in CreateNameIndex()
49 std::vector<int> index(graph.node_size()); in CreateNameIndex()
72 MutableGraphView* graph) { in AddScalarConstNodeHelper() argument
75 SetUniqueGraphNodeName(kConstOpName, graph->graph(), &node); in AddScalarConstNodeHelper()
87 return graph->AddNode(std::move(node)); in AddScalarConstNodeHelper()
92 NodeDef* AddScalarPlaceholder(DataType dtype, MutableGraphView* graph) { in AddScalarPlaceholder() argument
95 SetUniqueGraphNodeName(node.op(), graph->graph(), &node); in AddScalarPlaceholder()
99 return graph->AddNode(std::move(node)); in AddScalarPlaceholder()
[all …]
/external/tensorflow/tensorflow/python/profiler/internal/
Dflops_registry.py46 def _zero_flops(graph, node): argument
48 del graph, node # graph and node are unused
64 def _unary_op_flops(graph, node, ops_per_element=1): argument
66 in_shape = graph_util.tensor_shape_from_node_def_name(graph, node.input[0])
72 def _reciprocal_flops(graph, node): argument
74 return _unary_op_flops(graph, node)
78 def _square_flops(graph, node): argument
80 return _unary_op_flops(graph, node)
84 def _rsqrt_flops(graph, node): argument
87 return _unary_op_flops(graph, node, ops_per_element=2)
[all …]
/external/tensorflow/tensorflow/core/grappler/graph_analyzer/
Dtest_tools.cc151 GraphDef& graph = graph_3n_self_control_; in TestGraphs() local
153 (*graph.add_node()) = MakeNodeConst("node1"); in TestGraphs()
154 (*graph.add_node()) = MakeNodeSub("node2", "node3:1", "node3:0"); in TestGraphs()
155 auto node3 = graph.add_node(); in TestGraphs()
160 GraphDef& graph = graph_multi_input_; in TestGraphs() local
162 (*graph.add_node()) = MakeNodeConst("const1_1"); in TestGraphs()
163 (*graph.add_node()) = MakeNodeConst("const1_2"); in TestGraphs()
164 (*graph.add_node()) = MakeNodeAddN("add1", "const1_1", "const1_2"); in TestGraphs()
166 (*graph.add_node()) = MakeNodeConst("const2_1"); in TestGraphs()
167 (*graph.add_node()) = MakeNodeConst("const2_2"); in TestGraphs()
[all …]
/external/tensorflow/tensorflow/core/grappler/optimizers/
Dloop_optimizer_test.cc35 const std::vector<string>& inputs, GraphDef* graph) const { in AddEnterNode()
49 AddNode(name, "Enter", inputs, attributes, graph); in AddEnterNode()
53 const std::vector<string>& inputs, GraphDef* graph) const { in AddSimpleNode()
58 AddNode(name, op, inputs, attributes, graph); in AddSimpleNode()
80 GraphDef graph; in TEST_F() local
81 AddSimpleNode("In", "Identity", {}, &graph); in TEST_F()
83 &graph); in TEST_F()
85 &graph); in TEST_F()
86 AddSimpleNode("VariantAdd", "Add", {"InvariantAdd", "Identity"}, &graph); in TEST_F()
87 AddEnterNode("VariantEnter", "while/while_context", false, 1, {"In"}, &graph); in TEST_F()
[all …]
/external/tensorflow/tensorflow/core/grappler/utils/
Dframe_test.cc57 GraphDef graph; in TEST_F() local
59 *graph.add_node() = CreateNode("0", {}); in TEST_F()
60 *graph.add_node() = CreateNode("1", "Enter", "while/context1", {"0"}); in TEST_F()
61 *graph.add_node() = CreateNode("2", {"1"}); in TEST_F()
62 *graph.add_node() = CreateNode("3", "Merge", {"2", "14"}); in TEST_F()
63 *graph.add_node() = CreateNode("4", {"3"}); in TEST_F()
64 *graph.add_node() = CreateNode("5", "Switch", {"4"}); in TEST_F()
65 *graph.add_node() = CreateNode("6", {"5"}); in TEST_F()
66 *graph.add_node() = CreateNode("7", "Enter", "while/context2", {"6"}); in TEST_F()
67 *graph.add_node() = CreateNode("8", {"7"}); in TEST_F()
[all …]
Dtopological_sort_test.cc42 GraphDef graph; in CreateGraph() local
51 *graph.add_node() = std::move(node_def); in CreateGraph()
54 return graph; in CreateGraph()
59 GraphDef graph = CreateGraph({ in TEST_F() local
69 TF_EXPECT_OK(ComputeTopologicalOrder(graph, &topo_order)); in TEST_F()
79 TF_EXPECT_OK(TopologicalSort(&graph)); in TEST_F()
81 EXPECT_EQ(graph.node(i).name(), order[i]); in TEST_F()
86 GraphDef graph = CreateGraph({ in TEST_F() local
96 TF_EXPECT_OK(ComputeTopologicalOrder(graph, &topo_order)); in TEST_F()
106 TF_EXPECT_OK(TopologicalSort(&graph)); in TEST_F()
[all …]
/external/tensorflow/tensorflow/python/autograph/pyct/
Dcfg_test.py28 def __init__(self, graph): argument
29 super(CountingVisitor, self).__init__(graph)
57 graph, = graphs.values()
58 visitor = CountingVisitor(graph)
79 graph, = graphs.values()
80 visitor = CountingVisitor(graph)
109 def assertGraphMatches(self, graph, edges): argument
113 for cfg_node in graph.index.values():
121 'match failed for node "%s" in graph:\n%s' % (node_repr, graph))
123 def assertStatementEdges(self, graph, edges): argument
[all …]
/external/v8/tools/turbolizer/src/
Dgraph-view.ts62 var graph = this;
69 graph.selectionHandler.clear();
71 graph.svg = svg;
73 graph.nodes = [];
74 graph.edges = [];
76 graph.minGraphX = 0;
77 graph.maxGraphX = 1;
78 graph.minGraphY = 0;
79 graph.maxGraphY = 1;
81 graph.state = {
[all …]
/external/tensorflow/tensorflow/compiler/jit/
Dmark_for_compilation_pass_test.cc50 std::unordered_map<string, string> GetClusters(const Graph& graph) { in GetClusters() argument
52 for (Node* node : graph.nodes()) { in GetClusters()
89 std::unique_ptr<Graph> graph(new Graph(OpRegistry::Global())); in TEST() local
101 TF_EXPECT_OK(GraphDefBuilderToGraph(builder, graph.get())); in TEST()
104 TF_ASSERT_OK(MarkForCompilationPassTestHelper::MarkForCompilation(&graph)); in TEST()
105 auto clusters = GetClusters(*graph); in TEST()
115 std::unique_ptr<Graph> graph(new Graph(OpRegistry::Global())); in TEST() local
126 TF_EXPECT_OK(GraphDefBuilderToGraph(builder, graph.get())); in TEST()
129 TF_ASSERT_OK(MarkForCompilationPassTestHelper::MarkForCompilation(&graph)); in TEST()
130 auto clusters = GetClusters(*graph); in TEST()
[all …]
Dbuild_xla_ops_pass_test.cc59 auto graph = absl::make_unique<Graph>(OpRegistry::Global()); in BuildXlaOps() local
60 TF_RETURN_IF_ERROR(s.ToGraph(graph.get())); in BuildXlaOps()
61 FunctionLibraryDefinition flib_def(graph->op_registry(), fdef_lib); in BuildXlaOps()
65 for (Node* n : graph->nodes()) { in BuildXlaOps()
73 FixupSourceAndSinkEdges(graph.get()); in BuildXlaOps()
79 opt_options.graph = &graph; in BuildXlaOps()
82 VLOG(3) << graph->ToGraphDefDebug().DebugString(); in BuildXlaOps()
83 *result = std::move(graph); in BuildXlaOps()
87 Status MakeXlaCompiledKernel(Graph* graph, const string& callee_name, in MakeXlaCompiledKernel() argument
97 *result = graph->AddNode(call_node, &s); in MakeXlaCompiledKernel()
[all …]
/external/tensorflow/tensorflow/core/distributed_runtime/rpc/
Dgrpc_session_test.cc45 Graph graph(OpRegistry::Global()); in CreateGraphDef() local
49 Node* a = test::graph::Constant(&graph, a_tensor); in CreateGraphDef()
54 Node* b = test::graph::Constant(&graph, b_tensor); in CreateGraphDef()
57 Node* c = test::graph::Matmul(&graph, a, b, false, false); in CreateGraphDef()
60 test::graph::ToGraphDef(&graph, graph_def); in CreateGraphDef()
88 GraphDef graph; in TEST() local
91 CreateGraphDef(&graph, node_names); in TEST()
101 TF_CHECK_OK(session->Create(graph)); in TEST()
124 GraphDef graph; in TEST() local
127 CreateGraphDef(&graph, node_names); in TEST()
[all …]
/external/tensorflow/tensorflow/python/training/
Dtraining_util.py73 def get_global_step(graph=None): argument
89 graph = graph or ops.get_default_graph()
91 global_step_tensors = graph.get_collection(ops.GraphKeys.GLOBAL_STEP)
96 global_step_tensor = graph.get_tensor_by_name('global_step:0')
108 def create_global_step(graph=None): argument
121 graph = graph or ops.get_default_graph()
122 if get_global_step(graph) is not None:
136 with graph.as_default() as g, g.name_scope(None):
149 def get_or_create_global_step(graph=None): argument
159 graph = graph or ops.get_default_graph()
[all …]
/external/tensorflow/tensorflow/c/
Dpython_api.cc23 void AddControlInput(TF_Graph* graph, TF_Operation* op, TF_Operation* input) { in AddControlInput() argument
24 mutex_lock l(graph->mu); in AddControlInput()
25 graph->graph.AddControlEdge(&input->node, &op->node); in AddControlInput()
26 RecordMutation(graph, *op, "adding control input"); in AddControlInput()
29 void SetAttr(TF_Graph* graph, TF_Operation* op, const char* attr_name, in SetAttr() argument
39 mutex_lock l(graph->mu); in SetAttr()
41 RecordMutation(graph, *op, "setting attribute"); in SetAttr()
44 void ClearAttr(TF_Graph* graph, TF_Operation* op, const char* attr_name, in ClearAttr() argument
48 mutex_lock l(graph->mu); in ClearAttr()
50 RecordMutation(graph, *op, "clearing attribute"); in ClearAttr()
[all …]
/external/tensorflow/tensorflow/lite/
Dgraph_info_test.cc77 void PartitionGraph(const SimpleTestGraph& graph, in PartitionGraph() argument
82 PartitionGraphIntoIndependentNodeSubsets(&graph, nodes_to_partition_int_array, in PartitionGraph()
105 SimpleTestGraph graph; in TEST() local
108 PartitionGraph(graph, nodes_to_partition, &generated_subgraphs); in TEST()
117 SimpleTestGraph graph; in TEST() local
118 graph.AddTensors(1); in TEST()
119 graph.SetInputsAndOutputs({0}, {0}); in TEST()
122 PartitionGraph(graph, nodes_to_partition, &generated_subgraphs); in TEST()
130 SimpleTestGraph graph; in TEST() local
131 graph.AddTensors(2); in TEST()
[all …]
/external/tensorflow/tensorflow/core/graph/
Dquantize_training.cc71 inline bool IsGradientNode(const Graph* graph, const Node* node) { in IsGradientNode() argument
79 bool FindType(const Graph* graph, const Node* node, bool* signed_input, in FindType() argument
113 FindType(graph, edge->src(), signed_input, range_given, input_min, in FindType()
123 FindType(graph, edge->src(), signed_input, range_given, input_min, in FindType()
139 Status FindSaveOp(const Graph* graph, Node** save_op, in FindSaveOp() argument
142 for (Node* node : graph->op_nodes()) { in FindSaveOp()
156 Node* FindRestoreAllOp(const Graph* graph, StringPiece save_prefix) { in FindRestoreAllOp() argument
157 for (Node* node : graph->op_nodes()) { in FindRestoreAllOp()
185 Status ConnectVariablesToSaveOp(Graph* graph, Node* save_op, in ConnectVariablesToSaveOp() argument
235 TF_RETURN_IF_ERROR(save_op_builder.Finalize(graph, &new_save_op)); in ConnectVariablesToSaveOp()
[all …]
/external/v8/src/compiler/
Dint64-lowering.cc24 Int64Lowering::Int64Lowering(Graph* graph, MachineOperatorBuilder* machine, in Int64Lowering() argument
28 graph_(graph), in Int64Lowering()
31 state_(graph, 3), in Int64Lowering()
35 placeholder_(graph->NewNode(common->Parameter(-2, "placeholder"), in Int64Lowering()
36 graph->start())) { in Int64Lowering()
37 DCHECK_NOT_NULL(graph); in Int64Lowering()
38 DCHECK_NOT_NULL(graph->end()); in Int64Lowering()
39 replacements_ = zone->NewArray<Replacement>(graph->NodeCount()); in Int64Lowering()
40 memset(replacements_, 0, sizeof(Replacement) * graph->NodeCount()); in Int64Lowering()
47 stack_.push_back({graph()->end(), 0}); in LowerGraph()
[all …]
Djs-call-reducer.cc50 graph()->NewNode(simplified()->SpeculativeToNumber( in ReduceMathUnary()
53 Node* value = graph()->NewNode(op, input); in ReduceMathUnary()
76 graph()->NewNode(simplified()->SpeculativeToNumber( in ReduceMathBinary()
80 graph()->NewNode(simplified()->SpeculativeToNumber( in ReduceMathBinary()
83 Node* value = graph()->NewNode(op, left, right); in ReduceMathBinary()
107 graph()->NewNode(simplified()->SpeculativeToNumber( in ReduceMathImul()
111 graph()->NewNode(simplified()->SpeculativeToNumber( in ReduceMathImul()
114 left = graph()->NewNode(simplified()->NumberToUint32(), left); in ReduceMathImul()
115 right = graph()->NewNode(simplified()->NumberToUint32(), right); in ReduceMathImul()
116 Node* value = graph()->NewNode(simplified()->NumberImul(), left, right); in ReduceMathImul()
[all …]
/external/tensorflow/tensorflow/core/kernels/
Dmkl_conv_ops_test.cc121 auto* graph = new Graph(OpRegistry::Global()); in DefaultConv2D() local
126 Node* input = test::graph::Constant(graph, input_t, "input"); in DefaultConv2D()
127 Node* filter = test::graph::Constant(graph, filter_t, "filter"); in DefaultConv2D()
130 TF_CHECK_OK(NodeBuilder(graph->NewName("conv_2d"), "Conv2D") in DefaultConv2D()
136 .Finalize(graph, &conv2d)); in DefaultConv2D()
138 return graph; in DefaultConv2D()
143 auto* graph = new Graph(OpRegistry::Global()); in MklConv2D() local
148 Node* input = test::graph::Constant(graph, input_t, "input"); in MklConv2D()
149 Node* filter = test::graph::Constant(graph, filter_t, "filter"); in MklConv2D()
151 Node* not_mkl_shape = test::graph::Constant(graph, NonMklTensor(), "not_mkl"); in MklConv2D()
[all …]
/external/tensorflow/tensorflow/contrib/quantize/python/
Dquantize_test.py51 graph = ops.Graph()
52 with graph.as_default():
72 graph = ops.Graph()
73 with graph.as_default():
86 quantize.Quantize(graph, is_training, weight_bits=8, activation_bits=8)
89 conv_quant = graph.get_operation_by_name('test/test/conv_quant/' +
97 for op in graph.get_operations():
99 quant_op = graph.get_operation_by_name(op.name)
111 graph = ops.Graph()
112 with graph.as_default():
[all …]

12345678910>>...68