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 111 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, Skims_PA_cff::name, tfaot::BatchRule::nSizes(), PatBasicFWLiteJetAnalyzer_Selector_cfg::outputs, and mkLumiAveragedPlots::tuple.
113 size_t nInputs =
sizeof...(Inputs);
116 <<
"model '" <<
name() <<
"' received " << nInputs <<
" inputs, but " <<
wrapper_->nArgs() <<
" are expected";
120 size_t nOutputs =
sizeof...(Outputs);
121 if (nOutputs !=
wrapper_->nResults()) {
122 throw cms::Exception(
"OutputMismatch") <<
"requested " << nOutputs <<
" from model '" <<
name() <<
"', but " 123 <<
wrapper_->nResults() <<
" are provided";
137 size_t batchOffset = 0;
138 size_t nSizes = rule.nSizes();
139 for (
size_t i = 0;
i < nSizes;
i++) {
141 size_t bs = rule.getSize(
i);
142 size_t padding = (
i == nSizes - 1) ? rule.getLastPadding() : 0;
145 for (
size_t batchIndex = 0; batchIndex <
bs - padding; batchIndex++) {
154 for (
size_t batchIndex = 0; batchIndex <
bs - padding; batchIndex++) {
155 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... >)