mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-07 12:21:27 +01:00
[PyTorch] Fix missing move in unpickler (#63974)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/63974 Saw some time spent in this for model loading, no reason not to move here. ghstack-source-id: 136760979 Test Plan: Re-profile model loading on devserver; IValue copy ctor time has gone down Reviewed By: dhruvbird Differential Revision: D30548923 fbshipit-source-id: 42000f2e18582762b43353cca10ae094833de3b3
This commit is contained in:
parent
9777887f0e
commit
16ecdbbaa2
|
|
@ -318,7 +318,7 @@ PickleOpCode Unpickler::readInstruction() {
|
|||
tuple->elements().reserve(stack_.size() - start);
|
||||
auto start_it = stack_.begin() + start;
|
||||
for (auto it = start_it; it != stack_.end(); ++it) {
|
||||
tuple->elements().emplace_back(*it);
|
||||
tuple->elements().emplace_back(std::move(*it));
|
||||
}
|
||||
stack_.erase(start_it, stack_.end());
|
||||
stack_.emplace_back(std::move(tuple));
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user