Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions src/core/src/runtime/tensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ void read_tensor_via_ifstream(const std::filesystem::path& file_name, Tensor& te
std::ifstream fin(file_name, std::ios::binary);
fin.seekg(offset);
auto bytes_to_read = tensor.get_byte_size();
fin.read(static_cast<char*>(tensor.data()), bytes_to_read);
fin.read(static_cast<char*>(tensor.data()), static_cast<std::streamsize>(bytes_to_read));
OPENVINO_ASSERT(static_cast<size_t>(fin.gcount()) == bytes_to_read,
"Cannot read ",
bytes_to_read,
Expand Down Expand Up @@ -226,8 +226,7 @@ Tensor read_tensor_data(const std::filesystem::path& file_name,
bool mmap) {
OPENVINO_ASSERT(element_type != ov::element::string);
if (mmap) {
auto mapped_memory = ov::load_mmap_object(file_name);
return read_tensor_data_mmap_impl(mapped_memory, element_type, partial_shape, offset_in_bytes);
return read_tensor_data_mmap_impl(ov::load_mmap_object(file_name), element_type, partial_shape, offset_in_bytes);
} else {
auto file_size = std::filesystem::file_size(file_name);
auto static_shape = calc_static_shape_for_file(file_size, element_type, partial_shape, offset_in_bytes);
Expand All @@ -242,7 +241,6 @@ Tensor read_tensor_data(ov::FileHandle file_handle,
const ov::PartialShape& partial_shape,
size_t offset_in_bytes) {
OPENVINO_ASSERT(element_type != ov::element::string);
auto mapped_memory = ov::load_mmap_object(file_handle);
return read_tensor_data_mmap_impl(mapped_memory, element_type, partial_shape, offset_in_bytes);
return read_tensor_data_mmap_impl(ov::load_mmap_object(file_handle), element_type, partial_shape, offset_in_bytes);
}
} // namespace ov
Loading