| 501 | } |
| 502 | |
| 503 | Status 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 | |
| 521 | Status BundleWriter::AddSliceHeader( |
| 522 | string tensor_name, const TensorShape& shape, DataType type, bool is_hash, |
no test coverage detected