Home
last modified time | relevance | path

Searched refs:tensor (Results 1 – 25 of 33) sorted by relevance

12

/AliOS-Things-master/components/ai_agent/src/engine/tflite-micro/tensorflow/lite/experimental/examples/unity/TensorFlowLitePlugin/Assets/TensorFlowLite/SDK/Scripts/
A DInterpreter.cs126 return GetTensorInfo(tensor); in GetInputTensorInfo()
131 return GetTensorInfo(tensor); in GetOutputTensorInfo()
143 private static string GetTensorName(TfLiteTensor tensor) { in GetTensorName() argument
144 return Marshal.PtrToStringAnsi(TfLiteTensorName(tensor)); in GetTensorName()
147 private static TensorInfo GetTensorInfo(TfLiteTensor tensor) { in GetTensorInfo() argument
148 int[] dimensions = new int[TfLiteTensorNumDims(tensor)]; in GetTensorInfo()
150 dimensions[i] = TfLiteTensorDim(tensor, i); in GetTensorInfo()
153 name = GetTensorName(tensor), in GetTensorInfo()
154 type = TfLiteTensorType(tensor), in GetTensorInfo()
276 TfLiteTensor tensor, in TfLiteTensorCopyFromBuffer() argument
[all …]
/AliOS-Things-master/components/ai_agent/src/engine/tflite-micro/tensorflow/lite/c/
A Dcommon.c164 TfLiteTensorFree(tensor); in TfLiteTensorReset()
165 tensor->type = type; in TfLiteTensorReset()
166 tensor->name = name; in TfLiteTensorReset()
167 tensor->dims = dims; in TfLiteTensorReset()
168 tensor->params = quantization; in TfLiteTensorReset()
169 tensor->data.raw = buffer; in TfLiteTensorReset()
170 tensor->bytes = size; in TfLiteTensorReset()
172 tensor->allocation = allocation; in TfLiteTensorReset()
185 if (!tensor->data.raw) { in TfLiteTensorRealloc()
188 tensor->data.raw = realloc(tensor->data.raw, num_bytes); in TfLiteTensorRealloc()
[all …]
A Dc_api.h242 TFL_CAPI_EXPORT extern TfLiteType TfLiteTensorType(const TfLiteTensor* tensor);
245 TFL_CAPI_EXPORT extern int32_t TfLiteTensorNumDims(const TfLiteTensor* tensor);
249 TFL_CAPI_EXPORT extern int32_t TfLiteTensorDim(const TfLiteTensor* tensor,
253 TFL_CAPI_EXPORT extern size_t TfLiteTensorByteSize(const TfLiteTensor* tensor);
261 TFL_CAPI_EXPORT extern void* TfLiteTensorData(const TfLiteTensor* tensor);
264 TFL_CAPI_EXPORT extern const char* TfLiteTensorName(const TfLiteTensor* tensor);
271 const TfLiteTensor* tensor);
276 TfLiteTensor* tensor, const void* input_data, size_t input_data_size);
A Dcommon.h615 TfLiteTensor* tensor);
619 void TfLiteTensorRealloc(size_t num_bytes, TfLiteTensor* tensor);
689 TfLiteStatus (*ResizeTensor)(struct TfLiteContext*, TfLiteTensor* tensor,
768 TfLiteTensor* tensor, int dims,
924 TfLiteTensor* tensor);
931 TfLiteTensor* tensor);
/AliOS-Things-master/components/ai_agent/src/engine/tflite-micro/tensorflow/lite/kernels/internal/
A Dtensor_ctypes.h24 inline T* GetTensorData(TfLiteTensor* tensor) { in GetTensorData() argument
25 return tensor != nullptr ? reinterpret_cast<T*>(tensor->data.raw) : nullptr; in GetTensorData()
29 inline const T* GetTensorData(const TfLiteTensor* tensor) { in GetTensorData() argument
30 return tensor != nullptr ? reinterpret_cast<const T*>(tensor->data.raw) in GetTensorData()
34 inline RuntimeShape GetTensorShape(const TfLiteTensor* tensor) { in GetTensorShape() argument
35 if (tensor == nullptr) { in GetTensorShape()
39 TfLiteIntArray* dims = tensor->dims; in GetTensorShape()
/AliOS-Things-master/components/ai_agent/src/engine/tflite-micro/tensorflow/lite/core/api/
A Dtensor_utils.cc24 TfLiteStatus ResetVariableTensor(TfLiteTensor* tensor) { in ResetVariableTensor() argument
25 if (!tensor->is_variable) { in ResetVariableTensor()
31 if (tensor->type == kTfLiteInt8) { in ResetVariableTensor()
32 value = tensor->params.zero_point; in ResetVariableTensor()
39 memset(tensor->data.raw, value, tensor->bytes); in ResetVariableTensor()
41 char* raw_ptr = tensor->data.raw; in ResetVariableTensor()
42 for (size_t i = 0; i < tensor->bytes; ++i) { in ResetVariableTensor()
A Dtensor_utils.h24 TfLiteStatus ResetVariableTensor(TfLiteTensor* tensor);
/AliOS-Things-master/components/ai_agent/src/engine/tflite-micro/tensorflow/lite/kernels/
A Dkernel_util.h120 TfLiteTensor** tensor);
144 TfLiteTensor** tensor);
179 return tensor->allocation_type == kTfLiteMmapRo; in IsConstantTensor()
185 return tensor->allocation_type == kTfLiteDynamic; in IsDynamicTensor()
189 inline void SetTensorToDynamic(TfLiteTensor* tensor) { in SetTensorToDynamic() argument
190 if (tensor->allocation_type != kTfLiteDynamic) { in SetTensorToDynamic()
191 tensor->allocation_type = kTfLiteDynamic; in SetTensorToDynamic()
192 tensor->data.raw = nullptr; in SetTensorToDynamic()
198 if (tensor->allocation_type != kTfLitePersistentRo) { in SetTensorToPersistentRo()
199 tensor->allocation_type = kTfLitePersistentRo; in SetTensorToPersistentRo()
[all …]
A Dsubgraph_test_util.h141 void FillIntTensor(TfLiteTensor* tensor, const std::vector<int32_t>& data);
146 void FillScalarStringTensor(TfLiteTensor* tensor, const std::string& data);
149 void CheckScalarStringTensor(const TfLiteTensor* tensor,
153 void CheckStringTensor(const TfLiteTensor* tensor,
158 void CheckIntTensor(const TfLiteTensor* tensor, const std::vector<int>& shape,
161 void CheckBoolTensor(const TfLiteTensor* tensor, const std::vector<int>& shape,
A Dkernel_util.cc103 *tensor = GetTensorAtIndex(context, tensor_index); in GetMutableInputSafe()
115 int index, const TfLiteTensor** tensor) { in GetInputSafe() argument
116 return GetMutableInputSafe(context, node, index, tensor); in GetInputSafe()
121 TfLiteTensor* tensor = GetMutableInput(context, node, index); in GetVariableInput() local
122 return tensor->is_variable ? tensor : nullptr; in GetVariableInput()
136 int index, TfLiteTensor** tensor) { in GetOutputSafe() argument
141 *tensor = GetTensorAtIndex(context, tensor_index); in GetOutputSafe()
163 TfLiteTensor** tensor) { in GetTemporarySafe() argument
168 *tensor = GetTensorAtIndex(context, tensor_index); in GetTemporarySafe()
184 TfLiteTensor** tensor) { in GetIntermediatesSafe() argument
[all …]
A Dtest_util.h384 TfLiteTensor* t = interpreter_->tensor(index); in QuantizeAndPopulate()
404 TfLiteTensor* t = interpreter_->tensor(index); in PerChannelSymmetricQuantizeAndPopulate()
459 TfLiteTensor* t = interpreter_->tensor(index); in PerChannelQuantizeBias()
505 auto tensor = interpreter_->tensor(index); in PopulateStringTensor() local
519 auto* t = interpreter_->tensor(index); in PopulateTensor()
541 auto* t = interpreter_->tensor(index); in PopulateTensor()
561 auto* t = interpreter_->tensor(index); in PopulateTensor()
575 const auto* tensor = interpreter_->tensor(index); in ExtractVector() local
578 if (tensor->sparsity) { in ExtractVector()
582 tensor_size = tensor->sparsity in ExtractVector()
[all …]
/AliOS-Things-master/components/ai_agent/src/engine/tflite-micro/tensorflow/lite/micro/kernels/
A Dfill.cc31 const TfLiteTensor* tensor) { in EnsureEqImpl() argument
41 const TfLiteTensor* tensor) { in EnsureEq() argument
42 TF_LITE_ENSURE_EQ(context, NumDimensions(tensor), 1); in EnsureEq()
43 const auto tensor_len = tensor->dims->data[0]; in EnsureEq()
46 switch (tensor->type) { in EnsureEq()
48 return EnsureEqImpl<int8_t>(context, array, tensor); in EnsureEq()
50 return EnsureEqImpl<uint8_t>(context, array, tensor); in EnsureEq()
52 return EnsureEqImpl<int16_t>(context, array, tensor); in EnsureEq()
54 return EnsureEqImpl<int32_t>(context, array, tensor); in EnsureEq()
56 return EnsureEqImpl<int64_t>(context, array, tensor); in EnsureEq()
[all …]
A Dkernel_util.cc30 const RuntimeShape GetTensorShape(const TfLiteEvalTensor* tensor) { in GetTensorShape() argument
31 if (tensor == nullptr || tensor->dims == nullptr) { in GetTensorShape()
34 TfLiteIntArray* dims = tensor->dims; in GetTensorShape()
57 TfLiteTensor* tensor, in CreateWritableTensorDimsWithCopy() argument
59 TF_LITE_ENSURE(context, tensor != nullptr); in CreateWritableTensorDimsWithCopy()
61 int ranks = tensor->dims->size; in CreateWritableTensorDimsWithCopy()
65 TfLiteIntArray* old_dims = tensor->dims; in CreateWritableTensorDimsWithCopy()
67 tensor->dims = new_dims; in CreateWritableTensorDimsWithCopy()
A Dkernel_util.h55 T* GetTensorData(TfLiteEvalTensor* tensor) { in GetTensorData() argument
56 return tensor != nullptr ? reinterpret_cast<T*>(tensor->data.raw) : nullptr; in GetTensorData()
61 const T* GetTensorData(const TfLiteEvalTensor* tensor) { in GetTensorData() argument
62 TFLITE_DCHECK(tensor != nullptr); in GetTensorData()
63 return reinterpret_cast<const T*>(tensor->data.raw); in GetTensorData()
67 const RuntimeShape GetTensorShape(const TfLiteEvalTensor* tensor);
80 TfLiteTensor* tensor,
/AliOS-Things-master/components/ai_agent/src/engine/tflite-micro/tensorflow/lite/experimental/resource/
A Dresource_variable.cc47 TfLiteStatus ResourceVariable::AssignFrom(const TfLiteTensor* tensor) { in AssignFrom() argument
56 tensor_.type = tensor->type; in AssignFrom()
57 tensor_.params = tensor->params; in AssignFrom()
58 tensor_.quantization = tensor->quantization; in AssignFrom()
61 if (TfLiteIntArrayEqual(old_dims, tensor->dims)) { in AssignFrom()
65 tensor_.dims = TfLiteIntArrayCopy(tensor->dims); in AssignFrom()
70 if (old_bytes != tensor->bytes) { in AssignFrom()
71 TfLiteTensorRealloc(tensor->bytes, &tensor_); in AssignFrom()
76 memcpy(tensor_.data.raw, tensor->data.raw, tensor_.bytes); in AssignFrom()
A Dresource_variable_test.cc28 memset(tensor, 0, sizeof(TfLiteTensor)); in InitTensor()
38 false, tensor); in InitTensor()
45 TfLiteTensor tensor; in TEST() local
47 InitTensor(shape, kTfLiteArenaRw, 1.0f, &tensor); in TEST()
49 EXPECT_EQ(kTfLiteOk, var.AssignFrom(&tensor)); in TEST()
63 free(tensor.data.raw); in TEST()
64 TfLiteTensorFree(&tensor); in TEST()
71 TfLiteTensor tensor; in TEST() local
73 InitTensor(shape, kTfLiteDynamic, 1.0f, &tensor); in TEST()
75 EXPECT_EQ(kTfLiteOk, var.AssignFrom(&tensor)); in TEST()
[all …]
A Dresource_variable.h39 TfLiteStatus AssignFrom(const TfLiteTensor* tensor);
A DBUILD26 "//tensorflow/lite/kernels/internal:tensor",
/AliOS-Things-master/components/ai_agent/src/engine/tflite-micro/tensorflow/lite/
A Dstring_util.h87 void WriteToTensor(TfLiteTensor* tensor, TfLiteIntArray* new_shape);
90 void WriteToTensorAsVector(TfLiteTensor* tensor);
101 int GetStringCount(const TfLiteTensor* tensor);
106 StringRef GetString(const TfLiteTensor* tensor, int string_index);
A Dinterpreter.h254 TfLiteTensor* tensor(int tensor_index) { in tensor() function
255 return primary_subgraph().tensor(tensor_index); in tensor()
259 const TfLiteTensor* tensor(int tensor_index) const { in tensor() function
260 return primary_subgraph().tensor(tensor_index); in tensor()
274 if (TfLiteTensor* tensor_ptr = tensor(tensor_index)) { in typed_tensor()
286 if (const TfLiteTensor* tensor_ptr = tensor(tensor_index)) { in typed_tensor()
343 return tensor_index == -1 ? nullptr : tensor(tensor_index); in input_tensor_by_signature_name()
355 return tensor_index == -1 ? nullptr : tensor(tensor_index); in output_tensor_by_signature_name()
360 TfLiteTensor* input_tensor(size_t index) { return tensor(inputs()[index]); } in input_tensor()
365 return tensor(inputs()[index]); in input_tensor()
[all …]
A Dsimple_memory_arena.h40 int32_t tensor; member
47 tensor = -1; in reset()
75 int32_t tensor, int32_t first_node, int32_t last_node,
/AliOS-Things-master/components/ai_agent/src/engine/tflite-micro/tensorflow/lite/experimental/microfrontend/
A DREADME.md46 For example, a 200ms audio input will produce an output tensor of shape
56 This means that in the example above, we would generate a tensor of shape
63tensor’s first dimension, such that the tensor is shaped [-1, stack_size * num_channels]. For exam…
67 generate the output tensor, thus determining the second dimension. In the
68 example above, with a `frame_stride=3`, the output tensor would have a shape of
/AliOS-Things-master/components/ai_agent/src/engine/tflite-micro/tensorflow/lite/micro/
A Dmicro_allocator.cc788 TfLiteTensor* tensor = AllocatePersistentTfLiteTensorInternal(); in AllocatePersistentTfLiteTensor() local
794 model, tensor, tensor_index, subgraph_index, in AllocatePersistentTfLiteTensor()
807 tensor->data.data = in AllocatePersistentTfLiteTensor()
810 return tensor; in AllocatePersistentTfLiteTensor()
822 TfLiteTensor* tensor = in AllocateTempTfLiteTensor() local
843 tensor->data.data = in AllocateTempTfLiteTensor()
846 return tensor; in AllocateTempTfLiteTensor()
892 auto* tensor = subgraph->tensors()->Get(i); in AllocateVariables() local
893 if (tensor->is_variable()) { in AllocateVariables()
918 const Model* model, TfLiteTensor* tensor, int tensor_index, in PopulateTfLiteTensorFromFlatbuffer() argument
[all …]
A Dmicro_graph.cc199 auto* tensor = subgraph->tensors()->Get(i); in ResetVariableTensors() local
200 if (tensor->is_variable()) { in ResetVariableTensors()
206 if (tensor->type() == tflite::TensorType_INT8) { in ResetVariableTensors()
207 value = tensor->quantization()->zero_point()->Get(0); in ResetVariableTensors()
A Drecording_micro_allocator.cc202 const Model* model, TfLiteTensor* tensor, int tensor_index, in PopulateTfLiteTensorFromFlatbuffer() argument
207 model, tensor, tensor_index, subgraph_index, allocate_temp); in PopulateTfLiteTensorFromFlatbuffer()

Completed in 45 milliseconds

12