Skip to content

Commit

Permalink
recover unintentional deletions
Browse files Browse the repository at this point in the history
  • Loading branch information
Mun Jung Jung committed Mar 4, 2025
1 parent 0f8f4b6 commit 2b7cdfa
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pytorch/src/DNNROIFinding.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@
// become a dynamic option.

#ifdef DNNROI_HDF5_DEBUG
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpedantic"
#include <h5cpp/all>
#pragma GCC diagnostic pop
#endif

/// macro to register name - concrete pair in the NamedFactory
Expand Down Expand Up @@ -268,7 +271,10 @@ bool Pytorch::DNNROIFinding::operator()(const IFrame::pointer& inframe, IFrame::
log->debug(tk(fmt::format("call={} calling model \"{}\" with {} chunks ",
m_save_count, m_cfg.forward, m_cfg.nchunks)));
for (auto chunk : chunks) {
// G.P. If chunking is enabled, then the array is not contiguous in memory.
// To work around this, we need to clone the array.
std::vector<torch::IValue> itens {(m_cfg.nchunks > 1) ? chunk.clone() : chunk};

auto iitens = Pytorch::to_itensor(itens);
auto oitens = m_forward->forward(iitens);
torch::Tensor ochunk = Pytorch::from_itensor({oitens}).front().toTensor().cpu();
Expand Down

0 comments on commit 2b7cdfa

Please sign in to comment.