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

Method NewRandomAccessFile

tensorflow/core/util/memmapped_file_system.cc:100–113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98}
99
100Status MemmappedFileSystem::NewRandomAccessFile(
101 const string& filename, std::unique_ptr<RandomAccessFile>* result) {
102 if (!mapped_memory_) {
103 return errors::FailedPrecondition("MemmappedEnv is not initialized");
104 }
105 const auto dir_element = directory_.find(filename);
106 if (dir_element == directory_.end()) {
107 return errors::NotFound("Region ", filename, " is not found");
108 }
109 result->reset(new RandomAccessFileFromMemmapped(
110 GetMemoryWithOffset(dir_element->second.offset),
111 dir_element->second.length));
112 return Status::OK();
113}
114
115Status MemmappedFileSystem::NewReadOnlyMemoryRegionFromFile(
116 const string& filename, std::unique_ptr<ReadOnlyMemoryRegion>* result) {

Callers 10

VerifyFileFunction · 0.45
MutateSavedTensorSlicesFunction · 0.45
TESTFunction · 0.45
FlipEndiannessBitFunction · 0.45
MergeOneBundleFunction · 0.45
BundleReaderMethod · 0.45
GetValueMethod · 0.45
LookupHeaderMethod · 0.45
GetTensorInfoMethod · 0.45

Calls 5

FailedPreconditionFunction · 0.85
NotFoundFunction · 0.85
findMethod · 0.45
endMethod · 0.45
resetMethod · 0.45

Tested by 4

VerifyFileFunction · 0.36
MutateSavedTensorSlicesFunction · 0.36
TESTFunction · 0.36
FlipEndiannessBitFunction · 0.36