75 triton_input.
setShape({
static_cast<long int>(vec.size())});
83 ,
minHits(p.get<
size_t>(
"minHits"))
84 ,
debug(p.get<
bool>(
"debug"))
85 ,
planes(p.get<vector<std::string>>(
"planes"))
99 for (
auto const& tool_pset_labels : tool_psets.get_pset_names()) {
100 std::cout <<
"decoder lablel: " << tool_pset_labels << std::endl;
114 vector<art::Ptr<Hit>> hitlist;
115 vector<vector<size_t>> idsmap;
116 vector<NuGraphInput> graphinputs;
117 _loaderTool->loadData(e, hitlist, graphinputs, idsmap);
119 if (
debug) std::cout <<
"Hits size=" << hitlist.size() << std::endl;
120 if (hitlist.size() <
minHits) {
131 auto start = std::chrono::high_resolution_clock::now();
135 size_t batchSize = 1;
139 for (
auto& input_pair : inputs) {
140 const std::string& key = input_pair.first;
141 auto& triton_input = input_pair.second;
143 for (
auto& gi : graphinputs) {
144 if (key != gi.input_name)
continue;
155 auto end = std::chrono::high_resolution_clock::now();
156 std::chrono::duration<double> elapsed =
end - start;
157 std::cout <<
"Time taken for inference: " << elapsed.count() <<
" seconds" << std::endl;
162 vector<NuGraphOutput> infer_output;
163 for (
const auto& [name, data] : infer_result) {
164 const auto& prob = data.fromServer<
float>();
165 std::vector<float> out_data(prob[0].
begin(), prob[0].
end());
166 infer_output.emplace_back(name, std::move(out_data));
bool setShape(const ShapeType &newShape)
std::unique_ptr< LoaderToolBase > _loaderTool
fhicl::ParameterSet tritonPset
Declaration of signal hit object.
EDProducer(fhicl::ParameterSet const &pset)
NuGraphInferenceSonicTriton & operator=(NuGraphInferenceSonicTriton const &)=delete
void produce(art::Event &e) override
void toServer(std::shared_ptr< TritonInput< DT >> ptr)
NuGraphInferenceSonicTriton(fhicl::ParameterSet const &p)
decltype(auto) constexpr end(T &&obj)
ADL-aware version of std::end.
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
#define DEFINE_ART_MODULE(klass)
void setShapeAndToServer(lartriton::TritonData< triton::client::InferInput > &triton_input, vector< T > &vec, size_t batchSize)
std::vector< std::vector< DT >> TritonInput
T get(std::string const &key) const
std::vector< std::unique_ptr< DecoderToolBase > > _decoderToolsVec
ProducesCollector & producesCollector() noexcept
decltype(auto) constexpr begin(T &&obj)
ADL-aware version of std::begin.
2D representation of charge deposited in the TDC/wire plane
vector< std::string > planes
std::unique_ptr< lartriton::TritonClient > triton_client
std::string to_string() const