| 121 | } |
| 122 | |
| 123 | void TfLiteTensorReset(TfLiteType type, const char* name, TfLiteIntArray* dims, |
| 124 | TfLiteQuantizationParams quantization, char* buffer, |
| 125 | size_t size, TfLiteAllocationType allocation_type, |
| 126 | const void* allocation, bool is_variable, |
| 127 | TfLiteTensor* tensor) { |
| 128 | TfLiteTensorFree(tensor); |
| 129 | tensor->type = type; |
| 130 | tensor->name = name; |
| 131 | tensor->dims = dims; |
| 132 | tensor->params = quantization; |
| 133 | tensor->data.raw = buffer; |
| 134 | tensor->bytes = size; |
| 135 | tensor->allocation_type = allocation_type; |
| 136 | tensor->allocation = allocation; |
| 137 | tensor->is_variable = is_variable; |
| 138 | |
| 139 | tensor->quantization.type = kTfLiteNoQuantization; |
| 140 | tensor->quantization.params = NULL; |
| 141 | } |
| 142 | |
| 143 | void TfLiteTensorRealloc(size_t num_bytes, TfLiteTensor* tensor) { |
| 144 | if (tensor->allocation_type != kTfLiteDynamic) { |
no test coverage detected