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

Method AddSliceHeader

tensorflow/core/util/tensor_bundle/tensor_bundle.cc:521–538  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

519}
520
521Status 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
540Status BundleWriter::AddTensorHeader(StringPiece key, DataType dtype, TensorShape shape) {
541 if (!status_.ok()) return status_;

Callers 2

SaveBloomFilterFunction · 0.80
SaveHashTableHelperFunction · 0.80

Calls 8

has_shapeMethod · 0.80
TensorShapeClass · 0.50
okMethod · 0.45
dtypeMethod · 0.45
shapeMethod · 0.45
set_dtypeMethod · 0.45
AsProtoMethod · 0.45
mutable_shapeMethod · 0.45

Tested by

no test coverage detected