Imported Upstream version 1.25.0
[platform/core/ml/nnfw.git] / compiler / circle-eval-diff / src / InputDataLoader.cpp
index f15b2ba..7b491a3 100644 (file)
@@ -126,17 +126,19 @@ InputDataLoader::Data HDF5Loader::get(uint32_t data_idx) const
     data.at(input_idx) = *createEmptyTensor(input_node).get();
 
     auto input_buffer = data.at(input_idx).buffer();
+    const auto input_buffer_bytes = data.at(input_idx).byte_size();
+
     try
     {
       if (_hdf5->isRawData())
       {
-        _hdf5->readTensor(data_idx, input_idx, input_buffer);
+        _hdf5->readTensor(data_idx, input_idx, input_buffer, input_buffer_bytes);
       }
       else
       {
         DataType dtype;
         Shape shape;
-        _hdf5->readTensor(data_idx, input_idx, &dtype, &shape, input_buffer);
+        _hdf5->readTensor(data_idx, input_idx, &dtype, &shape, input_buffer, input_buffer_bytes);
 
         // Check the type and the shape of the input data is valid
         verifyTypeShape(input_node, dtype, shape);
@@ -164,7 +166,7 @@ DirectoryLoader::DirectoryLoader(const std::string &dir_path,
 
   struct dirent *entry = nullptr;
   const auto input_total_bytes = getTotalByteSizeOf(input_nodes);
-  while (entry = readdir(dir))
+  while ((entry = readdir(dir)))
   {
     // Skip if the entry is not a regular file
     if (entry->d_type != DT_REG)