Home
last modified time | relevance | path

Searched refs:tensor_index (Results 1 – 25 of 41) sorted by relevance

12

/external/tensorflow/tensorflow/lite/
Darena_planner.cc107 for (int tensor_index : graph_info_->outputs()) { in PlanAllocations() local
108 refcounts[tensor_index]++; in PlanAllocations()
113 for (int tensor_index : graph_info_->variables()) { in PlanAllocations() local
114 refcounts[tensor_index]++; in PlanAllocations()
119 for (int tensor_index : graph_info_->inputs()) { in PlanAllocations() local
120 if (tensor_index != kOptionalTensor) { in PlanAllocations()
122 refcounts[tensor_index]++; in PlanAllocations()
124 TF_LITE_ENSURE_STATUS(allocate(0, tensor_index)); in PlanAllocations()
129 for (int tensor_index : graph_info_->variables()) { in PlanAllocations() local
130 if (tensor_index != kOptionalTensor) { in PlanAllocations()
[all …]
Dinterpreter.h164 int tensor_index, TfLiteType type, const char* name,
170 int tensor_index, TfLiteType type, const char* name,
174 return SetTensorParametersReadOnly(tensor_index, type, name, dims.size(),
180 int tensor_index, TfLiteType type, const char* name, const size_t rank,
188 TfLiteStatus SetTensorParametersReadWrite(int tensor_index, TfLiteType type,
196 int tensor_index, TfLiteType type, const char* name,
199 return SetTensorParametersReadWrite(tensor_index, type, name, dims.size(),
203 int tensor_index, TfLiteType type, const char* name, const size_t rank,
252 TfLiteTensor* tensor(int tensor_index) { in tensor() argument
253 return primary_subgraph().tensor(tensor_index); in tensor()
[all …]
Dinterpreter.cc128 TfLiteStatus Interpreter::ResizeInputTensor(int tensor_index, in ResizeInputTensor() argument
130 return primary_subgraph().ResizeInputTensor(tensor_index, dims); in ResizeInputTensor()
137 for (int tensor_index : outputs()) { in Invoke() local
139 primary_subgraph().EnsureTensorDataIsReadable(tensor_index)); in Invoke()
156 int tensor_index, TfLiteType type, const char* name, in SetTensorParametersReadOnly() argument
160 tensor_index, type, name, dims.size(), dims.data(), quantization, buffer, in SetTensorParametersReadOnly()
165 int tensor_index, TfLiteType type, const char* name, in SetTensorParametersReadWrite() argument
169 tensor_index, type, name, dims.size(), dims.data(), quantization, in SetTensorParametersReadWrite()
174 int tensor_index, TfLiteType type, const char* name, const size_t rank, in SetTensorParametersReadOnly() argument
179 tensor_index, type, name, rank, dims, new_quantization, buffer, bytes, in SetTensorParametersReadOnly()
[all …]
Doptional_debug_tools.cc88 for (size_t tensor_index = 0; tensor_index < interpreter->tensors_size(); in PrintInterpreterState() local
89 tensor_index++) { in PrintInterpreterState()
90 TfLiteTensor* tensor = interpreter->tensor(static_cast<int>(tensor_index)); in PrintInterpreterState()
91 printf("Tensor %3zu %-20s %10s %15s %10zu bytes (%4.1f MB) ", tensor_index, in PrintInterpreterState()
Darena_planner.h78 TfLiteStatus ResolveTensorAllocation(int tensor_index);
81 TfLiteStatus CalculateTensorAllocation(int tensor_index);
84 TfLiteStatus CalculateTensorDeallocation(int tensor_index);
Darena_planner_test.cc185 int64_t GetOffset(int tensor_index) { in GetOffset() argument
186 const TfLiteTensor& tensor = (*graph_->tensors())[tensor_index]; in GetOffset()
192 int64_t GetOffsetAfter(int tensor_index) { in GetOffsetAfter() argument
193 const TfLiteTensor& tensor = (*graph_->tensors())[tensor_index]; in GetOffsetAfter()
194 int64_t offset = GetOffset(tensor_index) + tensor.bytes; in GetOffsetAfter()
423 auto is_unallocated = [&](int tensor_index) { in TEST_F() argument
424 return (*graph.tensors())[tensor_index].data.raw == nullptr; in TEST_F()
/external/tensorflow/tensorflow/lite/delegates/flex/
Dtest_util.h49 void SetTypedValues(int tensor_index, const std::vector<T>& values) { in SetTypedValues() argument
50 memcpy(interpreter_->typed_tensor<T>(tensor_index), values.data(), in SetTypedValues()
56 std::vector<T> GetTypedValues(int tensor_index) { in GetTypedValues() argument
57 const TfLiteTensor* t = interpreter_->tensor(tensor_index); in GetTypedValues()
58 const T* tdata = interpreter_->typed_tensor<T>(tensor_index); in GetTypedValues()
63 void SetValues(int tensor_index, const std::vector<float>& values) { in SetValues() argument
64 SetTypedValues<float>(tensor_index, values); in SetValues()
66 void SetStringValues(int tensor_index, const std::vector<string>& values);
69 std::vector<float> GetValues(int tensor_index) { in GetValues() argument
70 return GetTypedValues<float>(tensor_index); in GetValues()
[all …]
Dbuffer_map.cc135 bool BufferMap::HasTensor(int tensor_index) const { in HasTensor()
136 return id_to_tensor_.count(tensor_index) != 0; in HasTensor()
139 bool BufferMap::IsTensorFlowTensor(int tensor_index) const { in IsTensorFlowTensor()
140 return HasTensor(tensor_index) && owned_by_tf_.count(tensor_index) > 0; in IsTensorFlowTensor()
143 tensorflow::Tensor BufferMap::GetTensor(int tensor_index) const { in GetTensor()
144 return id_to_tensor_.at(tensor_index); in GetTensor()
147 void BufferMap::SetFromTfLite(int tensor_index, const TfLiteTensor* tensor) { in SetFromTfLite() argument
167 id_to_tensor_[tensor_index] = std::move(t); in SetFromTfLite()
168 owned_by_tf_.erase(tensor_index); in SetFromTfLite()
171 void BufferMap::SetFromTensorFlow(int tensor_index, tensorflow::Tensor tensor) { in SetFromTensorFlow() argument
[all …]
Dkernel.cc385 for (auto tensor_index : TfLiteIntArrayView(params->output_tensors)) { in Init() local
386 op_data->subgraph_outputs.push_back(tensor_index); in Init()
387 output_set.insert(tensor_index); in Init()
391 for (auto tensor_index : TfLiteIntArrayView(params->input_tensors)) { in Init() local
392 op_data->subgraph_inputs.push_back(tensor_index); in Init()
465 for (auto tensor_index : op_data->subgraph_inputs) { in Prepare() local
466 TfLiteTensor* tensor = &context->tensors[tensor_index]; in Prepare()
468 if (!buffer_map->HasTensor(tensor_index)) { in Prepare()
469 buffer_map->SetFromTfLite(tensor_index, tensor); in Prepare()
476 tensor_ref_count[tensor_index] += 2; in Prepare()
[all …]
Dbuffer_map.h39 bool HasTensor(int tensor_index) const;
44 bool IsTensorFlowTensor(int tensor_index) const;
48 tensorflow::Tensor GetTensor(int tensor_index) const;
53 void SetFromTensorFlow(int tensor_index, tensorflow::Tensor tensor);
57 void SetFromTfLite(int tensor_index, const TfLiteTensor* tensor);
Dtest_util.cc28 void FlexModelTest::SetStringValues(int tensor_index, in SetStringValues() argument
34 dynamic_buffer.WriteToTensor(interpreter_->tensor(tensor_index), in SetStringValues()
38 std::vector<string> FlexModelTest::GetStringValues(int tensor_index) const { in GetStringValues()
41 TfLiteTensor* tensor = interpreter_->tensor(tensor_index); in GetStringValues()
51 void FlexModelTest::SetShape(int tensor_index, const std::vector<int>& values) { in SetShape() argument
52 ASSERT_EQ(interpreter_->ResizeInputTensor(tensor_index, values), kTfLiteOk); in SetShape()
56 std::vector<int> FlexModelTest::GetShape(int tensor_index) { in GetShape() argument
58 auto* dims = interpreter_->tensor(tensor_index)->dims; in GetShape()
66 TfLiteType FlexModelTest::GetType(int tensor_index) { in GetType() argument
67 return interpreter_->tensor(tensor_index)->type; in GetType()
/external/tensorflow/tensorflow/lite/python/
Dinterpreter.py115 def _get_tensor_details(self, tensor_index): argument
127 tensor_index = int(tensor_index)
128 tensor_name = self._interpreter.TensorName(tensor_index)
129 tensor_size = self._interpreter.TensorSize(tensor_index)
130 tensor_type = self._interpreter.TensorType(tensor_index)
131 tensor_quantization = self._interpreter.TensorQuantization(tensor_index)
138 'index': tensor_index,
173 def set_tensor(self, tensor_index, value): argument
187 self._interpreter.SetTensor(tensor_index, value)
216 def get_tensor(self, tensor_index): argument
[all …]
/external/tensorflow/tensorflow/lite/core/
Dsubgraph.h89 int tensor_index, TfLiteType type, const char* name,
93 return SetTensorParametersReadOnly(tensor_index, type, name, dims.size(),
98 int tensor_index, TfLiteType type, const char* name, const size_t rank,
107 int tensor_index, TfLiteType type, const char* name,
110 return SetTensorParametersReadWrite(tensor_index, type, name, dims.size(),
113 TfLiteStatus SetTensorParametersReadWrite(int tensor_index, TfLiteType type,
126 TfLiteTensor* tensor(int tensor_index) { in tensor() argument
127 if (tensor_index < 0 || in tensor()
128 static_cast<size_t>(tensor_index) >= context_->tensors_size) { in tensor()
131 return &context_->tensors[tensor_index]; in tensor()
[all …]
Dsubgraph.cc306 for (int tensor_index : node_subset.output_tensors) { in ReplaceNodeSubsetsWithDelegateKernels() local
307 TfLiteTensor* tensor = &tensors_[tensor_index]; in ReplaceNodeSubsetsWithDelegateKernels()
580 TfLiteStatus Subgraph::ResizeInputTensor(int tensor_index, in ResizeInputTensor() argument
590 tensor_index < context_->tensors_size && tensor_index >= 0); in ResizeInputTensor()
591 TfLiteTensor* tensor = &context_->tensors[tensor_index]; in ResizeInputTensor()
705 int tensor_index = node.inputs->data[i]; in Invoke() local
706 if (tensor_index == kOptionalTensor) { in Invoke()
709 TfLiteTensor* tensor = &tensors_[tensor_index]; in Invoke()
712 TF_LITE_ENSURE_STATUS(EnsureTensorDataIsReadable(tensor_index)); in Invoke()
820 int tensor_index, TfLiteType type, const char* name, const size_t rank, in SetTensorParametersReadOnly() argument
[all …]
/external/tensorflow/tensorflow/lite/tools/
Dvisualize.py226 for tensor_input_position, tensor_index in enumerate(op["inputs"]):
227 if tensor_index not in first:
228 first[tensor_index] = (
232 "source": TensorName(tensor_index),
235 for tensor_index in op["outputs"]:
237 "target": TensorName(tensor_index),
247 for tensor_index, tensor in enumerate(g["tensors"]):
249 first[tensor_index] if tensor_index in first else len(g["operators"]))
252 "id": TensorName(tensor_index),
253 "name": "%s (%d)" % (tensor["name"], tensor_index),
/external/tensorflow/tensorflow/lite/experimental/writer/
Dwriter_lib.cc131 for (auto tensor_index : in ExportTensors() local
133 tensor_is_temporary[tensor_index] = true; in ExportTensors()
138 for (int tensor_index = 0; tensor_index < interpreter_->tensors_size(); in ExportTensors() local
139 tensor_index++) { in ExportTensors()
141 if (!tensor_is_temporary[tensor_index] && in ExportTensors()
142 unused_tensors_.find(tensor_index) == unused_tensors_.end()) { in ExportTensors()
143 tensor_to_written_tensor_[tensor_index] = curr_output_index++; in ExportTensors()
147 for (int tensor_index = 0; tensor_index < interpreter_->tensors_size(); in ExportTensors() local
148 ++tensor_index) { in ExportTensors()
150 if (tensor_to_written_tensor_[tensor_index] == -1) continue; in ExportTensors()
[all …]
/external/tensorflow/tensorflow/lite/experimental/micro/
Dmicro_interpreter.cc87 const int tensor_index = subgraph_->inputs()->Get(i); in MicroInterpreter() local
88 const auto* tensor = tensors_->Get(tensor_index); in MicroInterpreter()
91 &context_.tensors[tensor_index]); in MicroInterpreter()
109 const int tensor_index = op->inputs()->Get(n); in MicroInterpreter() local
110 if ((last_used[tensor_index] == -1) || (last_used[tensor_index] < i)) { in MicroInterpreter()
111 last_used[tensor_index] = i; in MicroInterpreter()
115 const int tensor_index = op->outputs()->Get(n); in MicroInterpreter() local
117 int destroy_after = last_used[tensor_index]; in MicroInterpreter()
121 const auto* tensor = tensors_->Get(tensor_index); in MicroInterpreter()
125 &context_.tensors[tensor_index]); in MicroInterpreter()
[all …]
/external/tensorflow/tensorflow/python/keras/engine/
Dnetwork.py268 layer, node_index, tensor_index = x._keras_history # pylint: disable=protected-access
270 self._output_coordinates.append((layer, node_index, tensor_index))
274 layer, node_index, tensor_index = x._keras_history # pylint: disable=protected-access
278 assert tensor_index == 0
280 self._input_coordinates.append((layer, node_index, tensor_index))
933 layer, node_index, tensor_index = self._output_coordinates[i]
934 shape_key = layer.name + '_%s_%s' % (node_index, tensor_index)
1101 layer, node_index, tensor_index = self._input_coordinates[i]
1107 tf_utils.ListWrapper([layer.name, new_node_index, tensor_index]))
1117 layer, node_index, tensor_index = self._output_coordinates[i]
[all …]
/external/tensorflow/tensorflow/tools/api/golden/v1/
Dtensorflow.lite.-interpreter.pbtxt23 argspec: "args=[\'self\', \'tensor_index\'], varargs=None, keywords=None, defaults=None"
43 …argspec: "args=[\'self\', \'tensor_index\', \'value\'], varargs=None, keywords=None, defaults=None"
47 argspec: "args=[\'self\', \'tensor_index\'], varargs=None, keywords=None, defaults=None"
/external/tensorflow/tensorflow/tools/api/golden/v2/
Dtensorflow.lite.-interpreter.pbtxt23 argspec: "args=[\'self\', \'tensor_index\'], varargs=None, keywords=None, defaults=None"
43 …argspec: "args=[\'self\', \'tensor_index\', \'value\'], varargs=None, keywords=None, defaults=None"
47 argspec: "args=[\'self\', \'tensor_index\'], varargs=None, keywords=None, defaults=None"
/external/tensorflow/tensorflow/core/protobuf/tpu/
Dtpu_embedding_output_layout.proto11 // particular positions within some output tensor (identified by "tensor_index"
22 int32 tensor_index = 1; field
25 // layout.output(tensor_index).dim0_size_per_sample().
29 // layout.output(tensor_index).dim1_size() - table width; repeated or
/external/tensorflow/tensorflow/lite/tools/optimize/calibration/
Dcalibration_logger.h67 void LogTensorValue(int tensor_index, const float* tensor_values, in LogTensorValue() argument
69 tensor_id_to_stats_map_[tensor_index].Update(tensor_values, tensor_size); in LogTensorValue()
/external/tensorflow/tensorflow/lite/delegates/nnapi/
Dnnapi_delegate.cc274 TfLiteStatus AddTensorInput(int tensor_index, bool hybrid_op) { in AddTensorInput() argument
275 return AddTensor(tensor_index, hybrid_op, &augmented_inputs_); in AddTensorInput()
278 TfLiteStatus AddTensorOutput(int tensor_index) { in AddTensorOutput() argument
279 return AddTensor(tensor_index, /*hybrid_op=*/false, &augmented_outputs_); in AddTensorOutput()
287 TfLiteStatus AddStateFloat32Tensor(int tensor_index, in AddStateFloat32Tensor() argument
289 TfLiteTensor* tensor = &context_->tensors[tensor_index]; in AddStateFloat32Tensor()
404 TfLiteStatus AddTensor(int tensor_index, bool hybrid_op, in AddTensor() argument
406 int ann_tensor_index = operand_mapping_->lite_index_to_ann(tensor_index); in AddTensor()
412 ann_tensor_index = operand_mapping_->add_new_ann_tensor_index(tensor_index); in AddTensor()
418 TfLiteTensor* tensor = &context_->tensors[tensor_index]; in AddTensor()
/external/tensorflow/tensorflow/lite/kernels/
Dsubgraph_test_util.cc46 void SetupTensor(Subgraph* subgraph, int tensor_index, TfLiteType type) { in SetupTensor() argument
47 ASSERT_EQ(subgraph->SetTensorParametersReadWrite(tensor_index, type, "", 0, in SetupTensor()
350 int tensor_index, in CreateConstantInt32Tensor() argument
367 tensor_index, kTfLiteInt32, "", shape, {}, in CreateConstantInt32Tensor()
/external/eigen/unsupported/Eigen/CXX11/src/Tensor/
DTensorConvolution.h593 …const int tensor_index = plane_input_offset + indexMapper.mapCudaInputKernelToTensorInputOffset(i+…
594 s[i + plane_kernel_offset] = eval.coeff(tensor_index);
610 …const int tensor_index = plane_output_offset + indexMapper.mapCudaOutputKernelToTensorOutputOffset…
611 buffer[tensor_index] = result;
652 …const int tensor_index = plane_input_offset + indexMapper.mapCudaInputKernelToTensorInputOffset(i+…
653 s[i + input_offset] = eval.coeff(tensor_index);
676 …const int tensor_index = plane_output_offset + indexMapper.mapCudaOutputKernelToTensorOutputOffset…
677 buffer[tensor_index] = result;
717 …const int tensor_index = plane_input_offset + indexMapper.mapCudaInputKernelToTensorInputOffset(i+…
718 … s[i + num_x_input * (j + num_y_input * (k + plane_kernel_offset))] = eval.coeff(tensor_index);
[all …]

12