Home
last modified time | relevance | path

Searched refs:tflite_tensor (Results 1 – 14 of 14) sorted by relevance

/external/tensorflow/tensorflow/lite/kernels/shim/
Dtflite_tensor_view_test.cc37 auto* tflite_tensor = interpreter.tensor(0); in TEST() local
38 ReallocDynamicTensor<bool>({3, 2}, tflite_tensor); in TEST()
39 tflite_tensor->name = "test_bool"; in TEST()
40 auto owned_tflite_tensor = UniqueTfLiteTensor(tflite_tensor); in TEST()
43 auto t_premove_or = TensorView::New(tflite_tensor); in TEST()
50 ASSERT_THAT(TfliteTensorDebugString(tflite_tensor), in TEST()
59 auto* tflite_tensor = interpreter.tensor(0); in IntTest() local
60 ReallocDynamicTensor<IntType>({3, 2}, tflite_tensor); in IntTest()
61 tflite_tensor->name = "test_int"; in IntTest()
62 auto owned_tflite_tensor = UniqueTfLiteTensor(tflite_tensor); in IntTest()
[all …]
Dtflite_op_shim.cc83 const auto* tflite_tensor = ::tflite::GetInput(context_, node_, idx); in GetInput() local
84 if (tflite_tensor == nullptr) in GetInput()
88 TensorView::New(tflite_tensor)); in GetInput()
98 auto* tflite_tensor = ::tflite::GetOutput(context_, node_, idx); in GetOutput() local
99 if (tflite_tensor == nullptr) in GetOutput()
102 if (tflite_tensor->data.raw == nullptr || in GetOutput()
103 tflite_tensor->allocation_type == kTfLiteDynamic) { in GetOutput()
106 context_->ResizeTensor(context_, tflite_tensor, output_shape_array); in GetOutput()
108 DCHECK(TfLiteShapeToShape(tflite_tensor->dims) == output_shape); in GetOutput()
111 TensorView::New(tflite_tensor)); in GetOutput()
[all …]
DREADME.md58 TfLiteTensor tflite_tensor;
59 auto t = TensorView::New(&tflite_tensor);
/external/tensorflow/tensorflow/lite/delegates/flex/
Dutil_test.cc196 TfLiteTensor tflite_tensor; in TEST() local
197 tflite_tensor.type = kTfLiteFloat32; in TEST()
198 tflite_tensor.allocation_type = kTfLiteDynamic; in TEST()
199 tflite_tensor.sparsity = nullptr; in TEST()
200 tflite_tensor.dims_signature = nullptr; in TEST()
205 tflite_tensor.quantization = quant; in TEST()
210 tflite_tensor.dims = dims; in TEST()
214 tflite_tensor.data.raw = static_cast<char*>(malloc(num_bytes)); in TEST()
215 memcpy(tflite_tensor.data.raw, data.data(), num_bytes); in TEST()
216 tflite_tensor.bytes = num_bytes; in TEST()
[all …]
Dutil.cc217 const TfLiteTensor* tflite_tensor) { in CreateTfTensorFromTfLiteTensor() argument
218 if (IsResourceOrVariant(tflite_tensor)) { in CreateTfTensorFromTfLiteTensor()
225 int num_dims = tflite_tensor->dims->size; in CreateTfTensorFromTfLiteTensor()
227 shape.AddDim(tflite_tensor->dims->data[i]); in CreateTfTensorFromTfLiteTensor()
231 tensorflow::DataType(GetTensorFlowDataType(tflite_tensor->type)), shape); in CreateTfTensorFromTfLiteTensor()
236 for (int i = 0; i < tflite::GetStringCount(tflite_tensor); ++buf, ++i) { in CreateTfTensorFromTfLiteTensor()
237 auto ref = GetString(tflite_tensor, i); in CreateTfTensorFromTfLiteTensor()
241 if (tf_tensor.tensor_data().size() != tflite_tensor->bytes) { in CreateTfTensorFromTfLiteTensor()
246 if (!tflite_tensor->data.raw) { in CreateTfTensorFromTfLiteTensor()
250 std::memcpy(tf_tensor.data(), tflite_tensor->data.raw, in CreateTfTensorFromTfLiteTensor()
[all …]
Dutil.h54 const TfLiteTensor* tflite_tensor);
/external/tensorflow/tensorflow/lite/delegates/gpu/common/
Dobject_reader.h77 const TfLiteTensor* tflite_tensor = context_->tensors + tensor_id; in ReadTensor() local
78 tensor->data.resize(NumElements(tflite_tensor)); in ReadTensor()
79 if (tflite_tensor->sparsity) { in ReadTensor()
81 dims.reserve(tflite_tensor->dims->size); in ReadTensor()
82 for (int i = 0; i < tflite_tensor->dims->size; ++i) { in ReadTensor()
83 dims.push_back(tflite_tensor->dims->data[i]); in ReadTensor()
85 switch (tflite_tensor->type) { in ReadTensor()
88 dims, *tflite_tensor->sparsity); in ReadTensor()
90 static_cast<const float*>(tflite_tensor->data.data)); in ReadTensor()
97 dims, *tflite_tensor->sparsity); in ReadTensor()
[all …]
Dobject_reader.cc45 TfLiteTensor* tflite_tensor = &context->tensors[tensor_idx]; in ReadNonConstantTensor() local
46 if (tflite::IsConstantTensor(tflite_tensor)) { in ReadNonConstantTensor()
51 if ((tflite_tensor->type == kTfLiteInt8 || in ReadNonConstantTensor()
52 tflite_tensor->type == kTfLiteUInt8) && in ReadNonConstantTensor()
68 tflite_tensor = &context->tensors[tensor_idx]; in ReadNonConstantTensor()
78 value->tensor.is_variable_input = tflite_tensor->is_variable; in ReadNonConstantTensor()
81 PopulateQuantParams(*tflite_tensor, &value->quant_params.value())); in ReadNonConstantTensor()
91 ConvertTfLiteTensorToTensorRef(*tflite_tensor, &value->tensor)); in ReadNonConstantTensor()
93 value->tensor.is_variable_input = tflite_tensor->is_variable; in ReadNonConstantTensor()
146 const TfLiteTensor& tflite_tensor = context_->tensors[tensor_idx]; in GetTensorDims() local
[all …]
Dmodel_builder_helper.cc98 absl::Status ExtractTensorShape(const TfLiteTensor& tflite_tensor, BHWC* bhwc) { in ExtractTensorShape() argument
99 const TfLiteIntArray* dims = tflite_tensor.dims; in ExtractTensorShape()
119 "Tensor \"", tflite_tensor.name ? tflite_tensor.name : "nullptr", in ExtractTensorShape()
124 absl::Status ExtractAxisFromIndex(const TfLiteTensor& tflite_tensor, int index, in ExtractAxisFromIndex() argument
126 const TfLiteIntArray* dims = tflite_tensor.dims; in ExtractAxisFromIndex()
158 absl::Status ConvertTfLiteTensorToTensorRef(const TfLiteTensor& tflite_tensor, in ConvertTfLiteTensorToTensorRef() argument
160 tensor_ref->type = ToDataType(tflite_tensor.type); in ConvertTfLiteTensorToTensorRef()
161 return ExtractTensorShape(tflite_tensor, &tensor_ref->shape); in ConvertTfLiteTensorToTensorRef()
Dmodel_builder_test.cc45 TfLiteTensor tflite_tensor; in TEST() local
46 tflite_tensor.name = "tensor_name"; in TEST()
47 tflite_tensor.type = TfLiteType::kTfLiteFloat32; in TEST()
48 tflite_tensor.dims = TfLiteIntArrayCreate(1); in TEST()
49 tflite_tensor.dims->data[0] = 4; in TEST()
52 ConvertTfLiteTensorToTensorRef(tflite_tensor, &tensor_ref); in TEST()
53 TfLiteIntArrayFree(tflite_tensor.dims); in TEST()
60 TfLiteTensor tflite_tensor; in TEST() local
61 tflite_tensor.name = "tensor_name"; in TEST()
62 tflite_tensor.type = TfLiteType::kTfLiteInt32; in TEST()
[all …]
Dmodel_builder_helper.h46 absl::Status ExtractTensorShape(const TfLiteTensor& tflite_tensor, BHWC* bhwc);
48 absl::Status ExtractAxisFromIndex(const TfLiteTensor& tflite_tensor, int index,
51 absl::Status ConvertTfLiteTensorToTensorRef(const TfLiteTensor& tflite_tensor,
Dmodel_builder.h90 absl::Status ConvertTfLiteTensorToTensorRef(const TfLiteTensor& tflite_tensor,
Dmodel_builder.cc3232 const TfLiteTensor& tflite_tensor = context->tensors[id]; in PrecreateIOTensors() local
3233 if (tflite::IsConstantTensor(&tflite_tensor)) continue; in PrecreateIOTensors()
/external/tensorflow/tensorflow/lite/delegates/gpu/
Ddelegate.cc182 const TfLiteTensor& tflite_tensor = context->tensors[tensor_index]; in Prepare() local
183 const DataType data_type = ToDataType(tflite_tensor.type); in Prepare()
191 const TfLiteTensor& tflite_tensor = context->tensors[tensor_index]; in Prepare() local
192 const DataType data_type = ToDataType(tflite_tensor.type); in Prepare()