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

Method GetBundleEntryProto

tensorflow/core/util/tensor_bundle/tensor_bundle.cc:949–968  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

947}
948
949Status BundleReader::GetBundleEntryProto(StringPiece key,
950 BundleEntryProto* entry) {
951 entry->Clear();
952 TF_CHECK_OK(status_);
953 Seek(key);
954 if (!iter_->Valid() || iter_->key() != key) {
955 return errors::NotFound("Key ", key, " not found in checkpoint");
956 }
957
958 BundleEntryProto entry_copy;
959 TF_RETURN_IF_ERROR(
960 ParseEntryProto(iter_->key(), iter_->value(), &entry_copy));
961 if (!TensorShape::IsValid(entry_copy.shape())) {
962 return errors::DataLoss("Invalid tensor shape: ", key, " ",
963 ProtoShortDebugString(entry_copy.shape()));
964 }
965
966 *entry = entry_copy;
967 return Status::OK();
968}
969
970Status BundleReader::GetValue(const BundleEntryProto& entry, Tensor* val) {
971 Tensor* ret = val;

Callers 1

ExpectAlignmentMethod · 0.80

Calls 8

NotFoundFunction · 0.85
ParseEntryProtoFunction · 0.85
IsValidFunction · 0.85
ClearMethod · 0.45
ValidMethod · 0.45
keyMethod · 0.45
valueMethod · 0.45
shapeMethod · 0.45

Tested by 1

ExpectAlignmentMethod · 0.64