MCPcopy Create free account
hub / github.com/Samsung/ONE / get

Method get

compiler/circle-eval-diff/src/InputDataLoader.cpp:117–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

115uint32_t HDF5Loader::size(void) const { return _hdf5->numData(); }
116
117InputDataLoader::Data HDF5Loader::get(uint32_t data_idx) const
118{
119 Data data;
120 data.resize(_input_nodes.size());
121
122 for (uint32_t input_idx = 0; input_idx < _input_nodes.size(); input_idx++)
123 {
124 auto input_node = loco::must_cast<luci::CircleInput *>(_input_nodes.at(input_idx));
125 assert(input_node->index() == input_idx);
126
127 data.at(input_idx) = *createEmptyTensor(input_node).get();
128
129 auto input_buffer = data.at(input_idx).buffer();
130 const auto input_buffer_bytes = data.at(input_idx).byte_size();
131
132 try
133 {
134 if (_hdf5->isRawData())
135 {
136 _hdf5->readTensor(data_idx, input_idx, input_buffer, input_buffer_bytes);
137 }
138 else
139 {
140 DataType dtype;
141 Shape shape;
142 _hdf5->readTensor(data_idx, input_idx, &dtype, &shape, input_buffer, input_buffer_bytes);
143
144 // Check the type and the shape of the input data is valid
145 verifyTypeShape(input_node, dtype, shape);
146 }
147 }
148 catch (const H5::Exception &e)
149 {
150 H5::Exception::printErrorStack();
151 throw std::runtime_error("HDF5 error occurred.");
152 }
153 }
154
155 return data;
156}
157
158DirectoryLoader::DirectoryLoader(const std::string &dir_path,
159 const std::vector<loco::Node *> &input_nodes)

Callers 15

entryFunction · 0.45
runMethod · 0.45
readModuleMethod · 0.45
entryFunction · 0.45
evaluateMethod · 0.45
runMethod · 0.45
TEST_FFunction · 0.45
TESTFunction · 0.45
TESTFunction · 0.45
TEST_FFunction · 0.45
runMethod · 0.45
TESTFunction · 0.45

Calls 15

createEmptyTensorFunction · 0.85
getTotalByteSizeOfFunction · 0.85
getEachByteSizeOfFunction · 0.85
byte_sizeMethod · 0.80
isRawDataMethod · 0.80
readTensorMethod · 0.80
verifyTypeShapeFunction · 0.70
resizeMethod · 0.45
sizeMethod · 0.45
atMethod · 0.45
indexMethod · 0.45
bufferMethod · 0.45

Tested by 8

TEST_FFunction · 0.36
TESTFunction · 0.36
TESTFunction · 0.36
TEST_FFunction · 0.36
TESTFunction · 0.36
TESTFunction · 0.36
TESTFunction · 0.36
part_evalFunction · 0.36