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

Function TF_StringDecode_Impl

tensorflow/c/tf_tensor.cc:226–240  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

224}
225
226static Status TF_StringDecode_Impl(const char* src, size_t src_len,
227 const char** dst, size_t* dst_len) {
228 tensorflow::uint64 len64 = 0;
229 const char* p = tensorflow::core::GetVarint64Ptr(src, src + src_len, &len64);
230 if (p == nullptr) {
231 return InvalidArgument("invalid string encoding or truncated src buffer");
232 }
233 if (len64 > std::numeric_limits<size_t>::max()) {
234 return InvalidArgument("encoded string is ", len64,
235 "-bytes, which is too large for this architecture");
236 }
237 *dst = p;
238 *dst_len = static_cast<size_t>(len64);
239 return Status::OK();
240}
241
242size_t TF_StringDecode(const char* src, size_t src_len, const char** dst,
243 size_t* dst_len, TF_Status* status) {

Callers 2

TF_StringDecodeFunction · 0.85
TF_TensorToTensorFunction · 0.85

Calls 3

GetVarint64PtrFunction · 0.85
InvalidArgumentFunction · 0.85
maxFunction · 0.50

Tested by

no test coverage detected