template<class W>
class tfaot::Model< W >
Definition at line 19 of file Model.h.
template<class W >
template<typename... Outputs, typename... Inputs>
std::tuple< Outputs... > Model::run |
( |
size_t |
batchSize, |
|
|
Inputs &&... |
inputs |
|
) |
| |
Definition at line 114 of file Model.h.
References HLT_FULL_cff::batchSize, cms::cuda::bs, tfaot::createIndexLooper(), Exception, tfaot::BatchRule::getLastPadding(), tfaot::BatchRule::getSize(), mps_fire::i, PixelMapPlotter::inputs, mergeVDriftHistosByStation::name, tfaot::BatchRule::nSizes(), PatBasicFWLiteJetAnalyzer_Selector_cfg::outputs, and mkLumiAveragedPlots::tuple.
116 size_t nInputs =
sizeof...(Inputs);
119 <<
"model '" <<
name() <<
"' received " << nInputs <<
" inputs, but " <<
wrapper_->nArgs() <<
" are expected";
123 size_t nOutputs =
sizeof...(Outputs);
124 if (nOutputs !=
wrapper_->nResults()) {
125 throw cms::Exception(
"OutputMismatch") <<
"requested " << nOutputs <<
" from model '" <<
name() <<
"', but " 126 <<
wrapper_->nResults() <<
" are provided";
140 size_t batchOffset = 0;
141 size_t nSizes = rule.nSizes();
142 for (
size_t i = 0;
i < nSizes;
i++) {
144 size_t bs = rule.getSize(
i);
145 size_t padding = (
i == nSizes - 1) ? rule.getLastPadding() : 0;
148 for (
size_t batchIndex = 0; batchIndex <
bs - padding; batchIndex++) {
157 for (
size_t batchIndex = 0; batchIndex <
bs - padding; batchIndex++) {
158 forEachOutput([&](
auto resultIndex) {
void extractBatchOutput(size_t batchSize, size_t batchIndex, size_t resultIndex, std::vector< T > &batchData) const
std::unique_ptr< W > wrapper_
void injectBatchInput(size_t batchSize, size_t batchIndex, size_t argIndex, const std::vector< T > &batchData)
const std::string & name() const
void reserveOutput(size_t batchSize, size_t resultIndex, std::vector< std::vector< T >> &data) const
const BatchRule & ensureRule(size_t batchSize)
auto createIndexLooper(std::index_sequence< Index... >)