MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / GetInputPerBatch

Function GetInputPerBatch

test/cpp/inference/api/tester_helper.h:453–464  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

451}
452
453void GetInputPerBatch(const std::vector<std::vector<int64_t>> &in,
454 std::vector<std::vector<int64_t>> *out,
455 std::vector<size_t> *lod,
456 size_t batch_iter,
457 size_t batch_end) {
458 lod->clear();
459 lod->push_back(0);
460 for (auto it = in.begin() + batch_iter; it < in.begin() + batch_end; it++) {
461 out->push_back(*it);
462 lod->push_back(lod->back() + (*it).size()); // calculate lod
463 }
464}
465
466void ConvertPaddleTensorToZeroCopyTensor(
467 PaddlePredictor *predictor, const std::vector<PaddleTensor> &inputs) {

Callers 3

NextBatchMethod · 0.85
NextBatchMethod · 0.85
NextBatchMethod · 0.85

Calls 5

clearMethod · 0.45
push_backMethod · 0.45
beginMethod · 0.45
backMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected