mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-27 20:02:15 +00:00
Optimize ExecutionFrame to avoid mem re-allocation. (#1085)
This commit is contained in:
parent
055f5af78d
commit
7421755198
1 changed files with 2 additions and 0 deletions
|
|
@ -190,6 +190,8 @@ ExecutionFrame::ExecutionFrame(const std::vector<int>& feed_mlvalue_idxs, const
|
|||
if (session_state.GetEnableMemoryPattern() && session_state.GetExecutionPlan()) {
|
||||
std::vector<TensorShape> input_shapes;
|
||||
bool all_tensors = true;
|
||||
// Reserve mem to avoid re-allocation.
|
||||
input_shapes.reserve(feeds.size());
|
||||
for (const auto& feed : feeds) {
|
||||
if (!(feed.IsTensor())) {
|
||||
all_tensors = false;
|
||||
|
|
|
|||
Loading…
Reference in a new issue