[torch] DRY a couple of lines in unpickler (#163447)

Test Plan: CI.

Reviewed By: dolpm

Differential Revision: D82660989

Pull Request resolved: https://github.com/pytorch/pytorch/pull/163447
Approved by: https://github.com/Skylion007
This commit is contained in:
Yedidya Feldblum
2025-09-21 20:29:30 +00:00
committed by PyTorch MergeBot
parent 4d3d32f14c
commit 8b14f43da9

View File

@ -262,10 +262,8 @@ void Unpickler::setInput(size_t memo_id) {
AT_ASSERT(!stack_.empty());
if (memo_id >= memo_table_.size()) {
memo_table_.resize(memo_id + 1);
memo_table_[memo_id] = stack_.back();
} else {
memo_table_[memo_id] = stack_.back();
}
memo_table_[memo_id] = stack_.back();
}
static std::vector<int64_t> tupleToIntList(const IValue& v) {