MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / TfLiteTensorReset

Function TfLiteTensorReset

tensorflow/lite/c/c_api_internal.c:123–141  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121}
122
123void 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
143void TfLiteTensorRealloc(size_t num_bytes, TfLiteTensor* tensor) {
144 if (tensor->allocation_type != kTfLiteDynamic) {

Callers 3

WriteToTensorMethod · 0.85

Calls 1

TfLiteTensorFreeFunction · 0.85

Tested by

no test coverage detected