43 auto num_run = _val_grp.getNumObjs();
44 for (uint32_t r = 0; r < num_run; ++r)
48 snprintf(path, 128,
"/value/run_%d/model_%d/subg_%d/op_%d", r, model_idx, subg_idx, op_idx);
49 if (!exists(_file.getId(), path))
51 auto run_grp = _val_grp.openGroup(std::string(
"run_") + std::to_string(r));
52 auto model_grp = run_grp.openGroup(std::string(
"model_") + std::to_string(model_idx));
53 auto subg_grp = model_grp.openGroup(std::string(
"subg_") + std::to_string(subg_idx));
54 auto op_dset = subg_grp.openDataSet(std::string(
"op_") + std::to_string(op_idx));
55 H5::DataType dtype = op_dset.getDataType();
56 if (not(dtype == H5::PredType::IEEE_F32BE || dtype == H5::PredType::IEEE_F32LE))
57 throw std::runtime_error{
"dtype of min, max in h5 is not float."};
58 op_dset.read(minmax, H5::PredType::NATIVE_FLOAT);
69 auto num_run = _val_grp.getNumObjs();
70 for (uint32_t r = 0; r < num_run; ++r)
74 snprintf(path, 128,
"/value/run_%d/model_%d/subg_%d/input_%d", r, model_idx, subg_idx,
76 if (!exists(_file.getId(), path))
78 auto run_grp = _val_grp.openGroup(std::string(
"run_") + std::to_string(r));
79 auto model_grp = run_grp.openGroup(std::string(
"model_") + std::to_string(model_idx));
80 auto subg_grp = model_grp.openGroup(std::string(
"subg_") + std::to_string(subg_idx));
81 auto op_dset = subg_grp.openDataSet(std::string(
"input_") + std::to_string(input_idx));
83 H5::DataType dtype = op_dset.getDataType();
84 if (not(dtype == H5::PredType::IEEE_F32BE || dtype == H5::PredType::IEEE_F32LE))
85 throw std::runtime_error{
"dtype of min, max in h5 is not float."};
86 op_dset.read(minmax, H5::PredType::NATIVE_FLOAT);