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

Method AddTensorHeader

tensorflow/core/util/tensor_bundle/tensor_bundle.cc:503–519  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

501}
502
503Status BundleWriter::AddTensorHeader(StringPiece key, DataType dtype) {
504 if (!status_.ok()) return status_;
505 CHECK_NE(key, kHeaderEntryKey);
506 const string key_string(key);
507 if (entries_.find(key_string) != entries_.end()) {
508 status_ = errors::InvalidArgument("Adding duplicate key: ", key);
509 return status_;
510 }
511
512 entry_seg_ = &entries_[key_string];
513 entry_seg_->set_dtype(dtype);
514 entry_seg_->set_shard_id(0);
515 entry_seg_->set_offset(size_);
516
517 out_->clear_crc32c();
518 return status_;
519}
520
521Status BundleWriter::AddSliceHeader(
522 string tensor_name, const TensorShape& shape, DataType type, bool is_hash,

Callers 2

BeginMethod · 0.80

Calls 9

InvalidArgumentFunction · 0.85
set_offsetMethod · 0.80
clear_crc32cMethod · 0.80
okMethod · 0.45
findMethod · 0.45
endMethod · 0.45
set_dtypeMethod · 0.45
AsProtoMethod · 0.45
mutable_shapeMethod · 0.45

Tested by

no test coverage detected