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

Method ReadCurrent

tensorflow/core/util/tensor_bundle/tensor_bundle.cc:1177–1193  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1175}
1176
1177Status BundleReader::ReadCurrent(Tensor* val) {
1178 CHECK(val != nullptr);
1179 BundleEntryProto entry;
1180 TF_RETURN_IF_ERROR(ParseEntryProto(iter_->key(), iter_->value(), &entry));
1181 if (!TensorShape::IsValid(entry.shape())) {
1182 return errors::DataLoss("Invalid tensor shape: ", iter_->key(), " ",
1183 ProtoShortDebugString(entry.shape()));
1184 }
1185
1186 if (entry.slices().empty()) {
1187 return GetValue(entry, val);
1188 } else {
1189 return GetSliceValue(
1190 iter_->key(), entry,
1191 /* a full slice */ TensorSlice(TensorShape(entry.shape()).dims()), val);
1192 }
1193}
1194
1195Status BundleReader::LookupTensorSlices(StringPiece key,
1196 std::vector<TensorSlice>* slices) {

Callers 2

GetNextInternalMethod · 0.80
ExpectNextFunction · 0.80

Calls 10

ParseEntryProtoFunction · 0.85
IsValidFunction · 0.85
TensorSliceClass · 0.85
GetValueFunction · 0.50
TensorShapeClass · 0.50
keyMethod · 0.45
valueMethod · 0.45
shapeMethod · 0.45
emptyMethod · 0.45
dimsMethod · 0.45

Tested by 1

ExpectNextFunction · 0.64