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

Method WriteToTensor

tensorflow/lite/string_util.cc:105–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103}
104
105void DynamicBuffer::WriteToTensor(TfLiteTensor* tensor,
106 TfLiteIntArray* new_shape) {
107 char* tensor_buffer;
108 int bytes = WriteToBuffer(&tensor_buffer);
109
110 if (new_shape == nullptr) {
111 new_shape = TfLiteIntArrayCopy(tensor->dims);
112 }
113
114 // Set tensor content pointer to tensor_buffer, and release original data.
115 TfLiteTensorReset(tensor->type, tensor->name, new_shape, tensor->params,
116 tensor_buffer, bytes, kTfLiteDynamic, tensor->allocation,
117 tensor->is_variable, tensor);
118}
119
120int GetStringCount(const char* raw_buffer) {
121 // The first integers in the raw buffer is the number of strings.

Callers 9

TESTFunction · 0.80
ResetInputsAndOutputsMethod · 0.80
SetTensorMethod · 0.80
CopyFromBufferHandleFunction · 0.80
SetStringValuesMethod · 0.80
MakeLiteTensor<string>Function · 0.80
PopulateStringTensorMethod · 0.80

Calls 2

TfLiteIntArrayCopyFunction · 0.85
TfLiteTensorResetFunction · 0.85

Tested by 4

TESTFunction · 0.64
SetStringValuesMethod · 0.64
MakeLiteTensor<string>Function · 0.64
PopulateStringTensorMethod · 0.64