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

Method PopulateStringTensor

tensorflow/lite/kernels/test_util.h:277–284  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

275 TfLiteStatus InvokeUnchecked();
276
277 void PopulateStringTensor(int index, const std::vector<string>& content) {
278 auto tensor = interpreter_->tensor(index);
279 DynamicBuffer buf;
280 for (const string& s : content) {
281 buf.AddString(s.data(), s.length());
282 }
283 buf.WriteToTensor(tensor, /*new_shape=*/nullptr);
284 }
285
286 // Populate the tensor given its index.
287 // TODO(b/110696148) clean up and merge with vector-taking variant below.

Callers

nothing calls this directly

Calls 5

AddStringMethod · 0.80
WriteToTensorMethod · 0.80
tensorMethod · 0.45
dataMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected