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

Method WriteData

tensorflow/core/util/tensor_bundle/tensor_bundle.cc:1443–1460  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1441}
1442
1443Status SegmentBundleWriter::WriteData(const void* data, int64 size) {
1444 while (size > 0) {
1445 if (buffer_ptr_ + size <= buffer_size_) {
1446 memcpy(buffer_.get() + buffer_ptr_, data, size);
1447 buffer_ptr_ += size;
1448 size = 0;
1449 } else {
1450 int64 w = buffer_size_ - buffer_ptr_;
1451 memcpy(buffer_.get() + buffer_ptr_, data, w);
1452 TF_RETURN_IF_ERROR(writer_->AppendSegmentData(buffer_.get(), buffer_size_));
1453 size -= w;
1454 data = (const char*)data + w;
1455 buffer_ptr_ = 0;
1456 write_counter_++;
1457 }
1458 }
1459 return Status::OK();
1460}
1461
1462Status SegmentBundleWriter::End() {
1463 if (write_counter_ * buffer_size_ + buffer_ptr_ !=

Callers 2

SaveBloomFilterFunction · 0.45
SaveHashTableHelperFunction · 0.45

Calls 2

AppendSegmentDataMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected