mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[AI Codemod][DevmatePerfOptimizationVectorReallocation] fbcode/caffe2/torch/csrc/jit/serialization/unpickler.cpp (#163240)
Reviewed By: marksantaniello, yfeldblum Differential Revision: D82140619 Pull Request resolved: https://github.com/pytorch/pytorch/pull/163240 Approved by: https://github.com/Skylion007
This commit is contained in:
committed by
PyTorch MergeBot
parent
9e3725e8e5
commit
8e3fd3d4f9
@ -261,9 +261,8 @@ void Unpickler::run() {
|
||||
void Unpickler::setInput(size_t memo_id) {
|
||||
AT_ASSERT(!stack_.empty());
|
||||
if (memo_id >= memo_table_.size()) {
|
||||
memo_table_.insert(
|
||||
memo_table_.end(), memo_id - memo_table_.size(), IValue());
|
||||
memo_table_.push_back(stack_.back());
|
||||
memo_table_.resize(memo_id + 1);
|
||||
memo_table_[memo_id] = stack_.back();
|
||||
} else {
|
||||
memo_table_[memo_id] = stack_.back();
|
||||
}
|
||||
|
Reference in New Issue
Block a user