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

Method Add

tensorflow/java/src/main/native/tensor_jni.cc:246–261  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

244 plimit_(poffsets_ + TF_TensorByteSize(t)) {}
245
246 void Add(const char* src, size_t len, TF_Status* status) {
247 if (TF_GetCode(status) != TF_OK) return;
248 if (plimit_ - poffsets_ < sizeof(offset_)) {
249 TF_SetStatus(status, TF_OUT_OF_RANGE,
250 "TF_STRING tensor encoding ran out of space for offsets, "
251 "this is likely a bug, please file an issue at "
252 "https://github.com/tensorflow/tensorflow/issues/new");
253 return;
254 }
255 memcpy(poffsets_, &offset_, sizeof(offset_));
256 size_t written =
257 TF_StringEncode(src, len, pdata_, (plimit_ - pdata_), status);
258 offset_ += written;
259 poffsets_ += 8;
260 pdata_ += written;
261 }
262
263 private:
264 uint64_t offset_;

Callers 1

Calls 3

TF_GetCodeFunction · 0.85
TF_SetStatusFunction · 0.85
TF_StringEncodeFunction · 0.85

Tested by

no test coverage detected