MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / open

Method open

utils/Utils.h:314–333  ·  view source on GitHub ↗

Open a NPY file and reads its metadata * * @param[in] npy_filename File to open * @param[in] file_layout (Optional) Layout in which the weights are stored in the file. */

Source from the content-addressed store, hash-verified

312 * @param[in] file_layout (Optional) Layout in which the weights are stored in the file.
313 */
314 void open(const std::string &npy_filename, DataLayout file_layout = DataLayout::NCHW)
315 {
316 ARM_COMPUTE_ERROR_ON(is_open());
317 try
318 {
319 _fs.open(npy_filename, std::ios::in | std::ios::binary);
320 ARM_COMPUTE_EXIT_ON_MSG_VAR(!_fs.good(), "Failed to load binary data from %s", npy_filename.c_str());
321 _fs.exceptions(std::ifstream::failbit | std::ifstream::badbit);
322 _file_layout = file_layout;
323
324 npy::header_t header = parse_npy_header(_fs);
325 _shape = header.shape;
326 _fortran_order = header.fortran_order;
327 _typestring = header.dtype.str();
328 }
329 catch (const std::ifstream::failure &e)
330 {
331 ARM_COMPUTE_ERROR_VAR("Accessing %s: %s", npy_filename.c_str(), e.what());
332 }
333 }
334 /** Return true if a NPY file is currently open */
335 bool is_open()
336 {

Callers 12

access_tensorMethod · 0.45
save_to_ppmFunction · 0.45
save_to_npyFunction · 0.45
load_trained_dataFunction · 0.45
get_image_type_from_fileFunction · 0.45
do_setupMethod · 0.45
do_setupMethod · 0.45
do_setupMethod · 0.45

Calls 3

parse_npy_headerFunction · 0.85
strMethod · 0.80
whatMethod · 0.45

Tested by

no test coverage detected