| 141 | } |
| 142 | |
| 143 | void TfLiteTensorRealloc(size_t num_bytes, TfLiteTensor* tensor) { |
| 144 | if (tensor->allocation_type != kTfLiteDynamic) { |
| 145 | return; |
| 146 | } |
| 147 | if (!tensor->data.raw) { |
| 148 | tensor->data.raw = malloc(num_bytes); |
| 149 | } else if (num_bytes > tensor->bytes) { |
| 150 | tensor->data.raw = realloc(tensor->data.raw, num_bytes); |
| 151 | } |
| 152 | tensor->bytes = num_bytes; |
| 153 | } |
| 154 | #endif // TF_LITE_STATIC_MEMORY |
| 155 | |
| 156 | const char* TfLiteTypeGetName(TfLiteType type) { |
no outgoing calls