Home
last modified time | relevance | path

Searched refs:subgraph (Results 1 – 25 of 135) sorted by relevance

123456

/external/tensorflow/tensorflow/lite/kernels/
Dsubgraph_test_util.cc31 void SetupTensor(Subgraph* subgraph, int tensor_index, TfLiteType type) { in SetupTensor() argument
32 ASSERT_EQ(subgraph->SetTensorParametersReadWrite(tensor_index, type, "", 0, in SetupTensor()
45 void SubgraphBuilder::BuildAddSubgraph(Subgraph* subgraph) { in BuildAddSubgraph() argument
55 ASSERT_EQ(subgraph->AddTensors(kTensorCount, &first_new_tensor_index), in BuildAddSubgraph()
58 ASSERT_EQ(subgraph->SetInputs({kInput1, kInput2}), kTfLiteOk); in BuildAddSubgraph()
59 ASSERT_EQ(subgraph->SetOutputs({kOutput}), kTfLiteOk); in BuildAddSubgraph()
61 SetupTensor(subgraph, kInput1, kTfLiteInt32); in BuildAddSubgraph()
62 SetupTensor(subgraph, kInput2, kTfLiteInt32); in BuildAddSubgraph()
63 SetupTensor(subgraph, kOutput, kTfLiteInt32); in BuildAddSubgraph()
69 subgraph->AddNodeWithParameters( in BuildAddSubgraph()
[all …]
Dsubgraph_test_util.h39 void BuildAddSubgraph(Subgraph* subgraph);
43 void BuildMulSubgraph(Subgraph* subgraph);
47 void BuildPadSubgraph(Subgraph* subgraph);
54 void BuildIfSubgraph(Subgraph* subgraph);
63 void BuildLessEqualCondSubgraph(Subgraph* subgraph, int rhs);
68 void BuildAccumulateLoopBodySubgraph(Subgraph* subgraph);
76 void BuildPadLoopBodySubgraph(Subgraph* subgraph,
81 void BuildWhileSubgraph(Subgraph* subgraph);
84 void CreateConstantInt32Tensor(Subgraph* subgraph, int tensor_index,
Dif.cc72 for (auto* subgraph : {then_subgraph, else_subgraph}) { in Prepare()
73 TF_LITE_ENSURE_EQ(context, num_inputs, subgraph->inputs().size()); in Prepare()
74 TF_LITE_ENSURE_EQ(context, num_outputs, subgraph->outputs().size()); in Prepare()
78 for (auto* subgraph : {then_subgraph, else_subgraph}) { in Prepare()
85 subgraph->ResizeInputTensor(i, dims); in Prepare()
86 TfLiteTensor* subgraph_input = subgraph->tensor(subgraph->inputs()[i]); in Prepare()
92 TF_LITE_ENSURE_OK(context, subgraph->AllocateTensors()); in Prepare()
93 has_dynamic_output_tensors |= subgraph->HasDynamicTensors(); in Prepare()
Dwhile_test.cc44 builder_->BuildLessEqualCondSubgraph(interpreter_->subgraph(1), i); in TEST_F()
45 builder_->BuildAccumulateLoopBodySubgraph(interpreter_->subgraph(2)); in TEST_F()
65 builder_->BuildLessEqualCondSubgraph(interpreter_->subgraph(1), 3); in TEST_F()
66 builder_->BuildPadLoopBodySubgraph(interpreter_->subgraph(2), {1, 2}); in TEST_F()
Dif_test.cc39 builder_->BuildAddSubgraph(interpreter_->subgraph(1)); in SetUp()
40 builder_->BuildMulSubgraph(interpreter_->subgraph(2)); in SetUp()
73 builder_->BuildAddSubgraph(interpreter_->subgraph(1)); in SetUp()
74 builder_->BuildPadSubgraph(interpreter_->subgraph(2)); in SetUp()
/external/XNNPACK/src/
Dsubgraph.c24 struct xnn_subgraph* subgraph = NULL; in xnn_create_subgraph() local
34 subgraph = xnn_allocate_zero_memory(sizeof(struct xnn_subgraph)); in xnn_create_subgraph()
35 if (subgraph == NULL) { in xnn_create_subgraph()
40 subgraph->external_value_ids = external_value_ids; in xnn_create_subgraph()
42 subgraph->values = xnn_allocate_zero_memory(external_value_ids * sizeof(struct xnn_value)); in xnn_create_subgraph()
43 if (subgraph->values == NULL) { in xnn_create_subgraph()
48 subgraph->values[i].id = i; in xnn_create_subgraph()
50 subgraph->num_values = external_value_ids; in xnn_create_subgraph()
51 subgraph->num_reserved_values = external_value_ids; in xnn_create_subgraph()
53 *subgraph_out = subgraph; in xnn_create_subgraph()
[all …]
Dtensor.c19 xnn_subgraph_t subgraph, in xnn_define_tensor_value() argument
33 if (external_id != XNN_INVALID_VALUE_ID && external_id >= subgraph->external_value_ids) { in xnn_define_tensor_value()
37 external_id, subgraph->external_value_ids); in xnn_define_tensor_value()
56 struct xnn_value* value = subgraph->values + external_id; in xnn_define_tensor_value()
58 value = xnn_subgraph_new_internal_value(subgraph); in xnn_define_tensor_value()
75 xnn_subgraph_t subgraph, in xnn_tensor_get_size() argument
78 assert(value_id < subgraph->num_values); in xnn_tensor_get_size()
80 const struct xnn_value* value = subgraph->values + value_id; in xnn_tensor_get_size()
/external/tensorflow/tensorflow/lite/tools/optimize/
Dquantize_model_test.cc189 for (const auto& subgraph : model_.subgraphs) { in TEST_F() local
190 for (const auto& tensor : subgraph->tensors) { in TEST_F()
203 const auto& subgraph = model_.subgraphs[subgraph_idx]; in TEST_F() local
208 EXPECT_EQ(subgraph->operators.size(), in TEST_F()
211 const auto& quant_op = subgraph->operators[0]; in TEST_F()
213 subgraph->operators[subgraph->operators.size() - 1]; in TEST_F()
221 EXPECT_EQ(subgraph->inputs.size(), 1); in TEST_F()
222 EXPECT_EQ(subgraph->outputs.size(), 1); in TEST_F()
223 const int32_t input_idx = subgraph->inputs[0]; in TEST_F()
224 const int32_t output_idx = subgraph->outputs[0]; in TEST_F()
[all …]
Dquantize_model.cc125 int32_t SetInputType(ModelT* model, SubGraphT* subgraph, in SetInputType() argument
127 TensorT* tensor = subgraph->tensors[tensor_idx].get(); in SetInputType()
144 const float scale = subgraph->tensors[tensor_idx]->quantization->scale[0]; in SetInputType()
146 subgraph->tensors[tensor_idx]->quantization->zero_point[0]; in SetInputType()
159 const int32_t leading_op_input_idx = subgraph->tensors.size(); in SetInputType()
160 subgraph->tensors.push_back(std::move(leading_op_input)); in SetInputType()
169 subgraph->operators.insert(subgraph->operators.begin(), in SetInputType()
179 int32_t SetOutputType(ModelT* model, SubGraphT* subgraph, in SetOutputType() argument
181 TensorT* tensor = subgraph->tensors[tensor_idx].get(); in SetOutputType()
196 const float scale = subgraph->tensors[tensor_idx]->quantization->scale[0]; in SetOutputType()
[all …]
Dquantize_weights.cc52 const SubGraphT* subgraph, in GetTensorConsumers() argument
57 for (size_t op_idx = 0; op_idx < subgraph->operators.size(); ++op_idx) { in GetTensorConsumers()
58 OperatorT* op = subgraph->operators[op_idx].get(); in GetTensorConsumers()
159 bool CheckAllOpInputsQuantized(const SubGraphT* subgraph, const OperatorT* op, in CheckAllOpInputsQuantized() argument
172 TensorT* tensor = subgraph->tensors[tensor_idx].get(); in CheckAllOpInputsQuantized()
187 SubGraphT* subgraph = model->subgraphs.at(0).get(); in InsertQuantizableInputTensorsFromOperator() local
201 TensorT* tensor = subgraph->tensors[tensor_idx].get(); in InsertQuantizableInputTensorsFromOperator()
309 const ModelT* model, const SubGraphT* subgraph, in PassQuantizationAndGetConsumers() argument
329 const TensorT* input_tensor = subgraph->tensors[input_tensor_idx].get(); in PassQuantizationAndGetConsumers()
330 TensorT* output_tensor = subgraph->tensors[output_tensor_idx].get(); in PassQuantizationAndGetConsumers()
[all …]
Dquantization_wrapper_utils.cc44 SubGraphT* subgraph = model->subgraphs.at(subgraph_idx).get(); in IntermediateTensorExists() local
45 for (size_t op_idx = 0; op_idx < subgraph->operators.size(); op_idx++) { in IntermediateTensorExists()
46 OperatorT* op = subgraph->operators[op_idx].get(); in IntermediateTensorExists()
78 SubGraphT* subgraph = model->subgraphs.at(subgraph_idx).get(); in AddIntemediateTensorsToFusedOp() local
79 for (size_t op_idx = 0; op_idx < subgraph->operators.size(); op_idx++) { in AddIntemediateTensorsToFusedOp()
81 OperatorT* op = subgraph->operators[op_idx].get(); in AddIntemediateTensorsToFusedOp()
88 const int next_tensor_index = subgraph->tensors.size(); in AddIntemediateTensorsToFusedOp()
94 subgraph->tensors.push_back(std::move(intermediate_tensor)); in AddIntemediateTensorsToFusedOp()
Dquantization_utils_test.cc472 auto subgraph = model.subgraphs[0].get(); in TEST_F() local
473 auto conv_op = subgraph->operators.at(0).get(); in TEST_F()
477 TensorT* weights_tensor = subgraph->tensors.at(weights_tensor_idx).get(); in TEST_F()
521 auto subgraph = model.subgraphs[0].get(); in TEST_F() local
522 auto conv_op = subgraph->operators.at(0).get(); in TEST_F()
526 TensorT* weights_tensor = subgraph->tensors.at(weights_tensor_idx).get(); in TEST_F()
555 auto subgraph = model.subgraphs[0].get(); in TEST_F() local
556 auto conv_op = subgraph->operators.at(0).get(); in TEST_F()
560 TensorT* weights_tensor = subgraph->tensors.at(weights_tensor_idx).get(); in TEST_F()
587 auto subgraph = model.subgraphs[0].get(); in TEST_F() local
[all …]
Dmodel_utils.cc107 bool HasBuffer(const ModelT* model, const SubGraphT* subgraph, in HasBuffer() argument
109 const int buffer_index = subgraph->tensors[tensor_index]->buffer; in HasBuffer()
125 SubGraphT* subgraph = model->subgraphs.at(subgraph_idx).get(); in SetOperatorCodeVersion() local
127 for (int op_idx = subgraph->operators.size() - 1; op_idx >= 0; op_idx--) { in SetOperatorCodeVersion()
128 OperatorT* op = subgraph->operators[op_idx].get(); in SetOperatorCodeVersion()
/external/tensorflow/tensorflow/compiler/mlir/lite/
Dtf_tfl_translate.cc75 auto print_buffer = [&](const tflite::SubGraph &subgraph, int id, int buffer, in PrintFunctionResultMapping()
77 const auto &output_tensor = (*subgraph.tensors())[buffer]; in PrintFunctionResultMapping()
88 for (auto *subgraph : *(*model)->subgraphs()) { in PrintFunctionResultMapping()
90 subgraph->name() ? subgraph->name()->str() : "<<unnamed subgraph>>"; in PrintFunctionResultMapping()
94 for (auto input : *subgraph->inputs()) in PrintFunctionResultMapping()
95 print_buffer(*subgraph, i++, input, nullptr); in PrintFunctionResultMapping()
99 if (subgraph->name()) { in PrintFunctionResultMapping()
100 if (auto fn = module.lookupSymbol<FuncOp>(subgraph->name()->str())) in PrintFunctionResultMapping()
104 for (auto output : *subgraph->outputs()) { in PrintFunctionResultMapping()
105 print_buffer(*subgraph, i, output, [&](int i) { in PrintFunctionResultMapping()
Dflatbuffer_import.cc617 const tflite::SubGraphT& subgraph, Location base_loc, in GetOutputTensorIndices() argument
620 return llvm::SmallVector<int32_t, 4>(subgraph.outputs.begin(), in GetOutputTensorIndices()
621 subgraph.outputs.end()); in GetOutputTensorIndices()
633 for (const auto& tensor : subgraph.tensors) { in GetOutputTensorIndices()
656 const tflite::SubGraphT& subgraph, Builder* builder, const std::string name, in BuildTFEntryFunctionAttribute() argument
659 [&](int i) { return subgraph.tensors.at(i)->name; }, indices); in BuildTFEntryFunctionAttribute()
667 const tflite::SubGraphT& subgraph, ArrayRef<int32_t> output_indices) { in PruneSubgraph() argument
670 for (const auto& op : subgraph.operators) { in PruneSubgraph()
717 const tflite::SubGraphT& subgraph, llvm::StringRef name, in ConvertSubgraph() argument
731 for (auto input : subgraph.inputs) { in ConvertSubgraph()
[all …]
/external/tensorflow/tensorflow/core/graph/
Dsubgraph_test.cc110 Graph* subgraph = new Graph(OpRegistry::Global()); in Subgraph() local
111 CopyGraph(*g_, subgraph); in Subgraph()
119 subgraph::RewriteGraphMetadata metadata; in Subgraph()
120 Status s = subgraph::RewriteGraphForExecution( in Subgraph()
121 subgraph, fed, fetch, targets, device_info_, use_function_convention, in Subgraph()
124 delete subgraph; in Subgraph()
132 g_.reset(subgraph); in Subgraph()
376 Graph* subgraph = new Graph(OpRegistry::Global()); in BM_SubgraphHelper() local
377 CopyGraph(g, subgraph); in BM_SubgraphHelper()
378 subgraph::RewriteGraphMetadata metadata; in BM_SubgraphHelper()
[all …]
/external/tensorflow/tensorflow/lite/tools/versioning/
Dop_version.cc333 TensorType GetTensorType(int32_t idx, const SubGraph* subgraph) { in GetTensorType() argument
341 if (subgraph->tensors() && idx < subgraph->tensors()->Length()) { in GetTensorType()
342 return subgraph->tensors()->Get(idx)->type(); in GetTensorType()
354 const SubGraph* subgraph) { in GetOpSignature() argument
392 subgraph->tensors()->Get(op->inputs()->Get(0)); in GetOpSignature()
394 subgraph->tensors()->Get(op->inputs()->Get(1)); in GetOpSignature()
396 subgraph->tensors()->Get(op->outputs()->Get(0)); in GetOpSignature()
434 TensorType tensor_type = GetTensorType(op->inputs()->Get(i), subgraph); in GetOpSignature()
438 TensorType tensor_type = GetTensorType(op->outputs()->Get(i), subgraph); in GetOpSignature()
449 const SubGraph* subgraph = subgraphs->Get(i); in UpdateOpVersion() local
[all …]
/external/tensorflow/tensorflow/lite/tools/
Dverifier.cc362 bool VerifySubGraphConsistency(const Model& model, const SubGraph& subgraph, in VerifySubGraphConsistency() argument
366 if (subgraph.tensors()) { in VerifySubGraphConsistency()
367 for (int i = 0; i < subgraph.tensors()->Length(); ++i) { in VerifySubGraphConsistency()
368 const auto* tensor = subgraph.tensors()->Get(i); in VerifySubGraphConsistency()
376 if (subgraph.inputs()) { in VerifySubGraphConsistency()
377 for (const int tensor_idx : *subgraph.inputs()) { in VerifySubGraphConsistency()
382 if (subgraph.operators()) { in VerifySubGraphConsistency()
383 for (int op_idx = 0; op_idx < subgraph.operators()->Length(); ++op_idx) { in VerifySubGraphConsistency()
384 const auto* op = subgraph.operators()->Get(op_idx); in VerifySubGraphConsistency()
452 for (const auto& subgraph : *model.subgraphs()) { in VerifySubGraphs()
[all …]
/external/guava/android/guava/src/com/google/common/graph/
DGraphs.java462 MutableGraph<N> subgraph = in inducedSubgraph() local
467 subgraph.addNode(node); in inducedSubgraph()
469 for (N node : subgraph.nodes()) { in inducedSubgraph()
471 if (subgraph.nodes().contains(successorNode)) { in inducedSubgraph()
472 subgraph.putEdge(node, successorNode); in inducedSubgraph()
476 return subgraph; in inducedSubgraph()
489 MutableValueGraph<N, V> subgraph = in inducedSubgraph() local
494 subgraph.addNode(node); in inducedSubgraph()
496 for (N node : subgraph.nodes()) { in inducedSubgraph()
498 if (subgraph.nodes().contains(successorNode)) { in inducedSubgraph()
[all …]
/external/guava/guava/src/com/google/common/graph/
DGraphs.java478 MutableGraph<N> subgraph = in inducedSubgraph() local
483 subgraph.addNode(node); in inducedSubgraph()
485 for (N node : subgraph.nodes()) { in inducedSubgraph()
487 if (subgraph.nodes().contains(successorNode)) { in inducedSubgraph()
488 subgraph.putEdge(node, successorNode); in inducedSubgraph()
492 return subgraph; in inducedSubgraph()
505 MutableValueGraph<N, V> subgraph = in inducedSubgraph() local
510 subgraph.addNode(node); in inducedSubgraph()
512 for (N node : subgraph.nodes()) { in inducedSubgraph()
514 if (subgraph.nodes().contains(successorNode)) { in inducedSubgraph()
[all …]
/external/tensorflow/tensorflow/lite/schema/
Dupgrade_schema.py191 subgraph = {}
193 subgraph[key_to_promote] = data[key_to_promote]
195 data["subgraphs"] = [subgraph]
254 for subgraph in data["subgraphs"]:
255 for ops in subgraph["operators"]:
281 for subgraph in data["subgraphs"]:
282 if "tensors" not in subgraph:
284 for tensor in subgraph["tensors"]:
/external/tensorflow/tensorflow/lite/
Dinterpreter.cc178 Subgraph* subgraph = new Subgraph(error_reporter_, external_contexts_, in AddSubgraphs() local
180 subgraphs_.emplace_back(subgraph); in AddSubgraphs()
270 for (auto& subgraph : subgraphs_) { in SetNumThreads() local
271 subgraph->context()->recommended_num_threads = num_threads; in SetNumThreads()
283 for (auto& subgraph : subgraphs_) { in SetAllowFp16PrecisionForFp32() local
284 subgraph->context()->allow_fp32_relax_to_fp16 = allow; in SetAllowFp16PrecisionForFp32()
292 for (auto& subgraph : subgraphs_) { in SetCancellationFunction() local
293 subgraph->SetCancellationFunction(data, check_cancelled_func); in SetCancellationFunction()
298 for (auto& subgraph : subgraphs_) { in ModifyGraphWithDelegate() local
299 TF_LITE_ENSURE_OK(context_, subgraph->ModifyGraphWithDelegate(delegate)); in ModifyGraphWithDelegate()
Dmodel.cc289 Subgraph* subgraph) { in ParseNodes() argument
293 subgraph->ReserveNodes(operators->Length()); in ParseNodes()
324 subgraph->AddNodeWithParameters( in ParseNodes()
331 subgraph->AddNodeWithParameters( in ParseNodes()
342 subgraph->AddNodeWithParameters( in ParseNodes()
510 Subgraph* subgraph) { in ParseTensors() argument
592 if (subgraph->SetTensorParametersReadOnly( in ParseTensors()
600 if (subgraph->SetTensorParametersReadWrite( in ParseTensors()
683 const tflite::SubGraph* subgraph = (*subgraphs)[subgraph_index]; in operator ()() local
685 (*interpreter)->subgraph(subgraph_index); in operator ()()
[all …]
/external/tensorflow/tensorflow/core/common_runtime/
Dpartitioning_utils.cc58 std::unique_ptr<Graph> subgraph( in PartitionFunctionGraph() local
61 TF_CHECK_OK(subgraph->AddFunctionLibrary(global_flib.ToProto())); in PartitionFunctionGraph()
66 ConvertGraphDefToGraph(opts, std::move(graph_def), subgraph.get())); in PartitionFunctionGraph()
67 subgraphs->emplace(device, std::move(subgraph)); in PartitionFunctionGraph()
74 Graph* subgraph, const string& device_type, std::vector<int>* arg_indices, in UpdateArgAndRetvalMetadata() argument
84 for (Node* node : subgraph->op_nodes()) { in UpdateArgAndRetvalMetadata()
/external/dagger2/java/dagger/example/spi/
DBindingGraphVisualizer.java231 DotGraph subgraph = subgraph(component); in graph() local
232 subgraph.add( in graph()
237 subgraph.add(new DotStatement<>("graph").addAttribute("label", component)); in graph()
239 subgraph.add(dotNode(node)); in graph()
249 DotGraph subgraph(ComponentPath component) { in subgraph() method in BindingGraphVisualizer.NodesGraph
250 DotGraph subgraph = new DotGraph("subgraph " + quote(clusterName(component))); in subgraph() local
251 graph.add(subgraph); in subgraph()
252 return subgraph; in subgraph()

123456