| 1063 | } |
| 1064 | |
| 1065 | Status BundleReader::Lookup(StringPiece key, Tensor* val) { |
| 1066 | CHECK(val != nullptr); |
| 1067 | BundleEntryProto entry; |
| 1068 | TF_RETURN_IF_ERROR(GetBundleEntryProto(key, &entry)); |
| 1069 | |
| 1070 | if (entry.slices().empty()) { |
| 1071 | return GetValue(entry, val); |
| 1072 | } else { |
| 1073 | return GetSliceValue( |
| 1074 | key, entry, |
| 1075 | /* a full slice */ TensorSlice(TensorShape(entry.shape()).dims()), val); |
| 1076 | } |
| 1077 | } |
| 1078 | |
| 1079 | Status BundleReader::LookupHeader(StringPiece tensor_key, int64 total_bytes) { |
| 1080 | BundleEntryProto entry; |