| 519 | } |
| 520 | |
| 521 | Status BundleWriter::AddSliceHeader( |
| 522 | string tensor_name, const TensorShape& shape, DataType type, bool is_hash, |
| 523 | TensorSliceProto** proto) { |
| 524 | if (!status_.ok()) return status_; |
| 525 | BundleEntryProto* full_entry = &entries_[tensor_name]; |
| 526 | if (full_entry->dtype() != DT_INVALID) { |
| 527 | CHECK_EQ(full_entry->dtype(), type); |
| 528 | } |
| 529 | if (full_entry->has_shape()) { |
| 530 | CHECK(TensorShape(full_entry->shape()) == shape); |
| 531 | } |
| 532 | |
| 533 | full_entry->set_is_hash_table(is_hash); |
| 534 | full_entry->set_dtype(type); |
| 535 | shape.AsProto(full_entry->mutable_shape()); |
| 536 | *proto = full_entry->add_slices(); |
| 537 | return Status::OK(); |
| 538 | } |
| 539 | |
| 540 | Status BundleWriter::AddTensorHeader(StringPiece key, DataType dtype, TensorShape shape) { |
| 541 | if (!status_.ok()) return status_; |
no test coverage detected