mirror of
https://github.com/pytorch/pytorch.git
synced 2026-11-20 09:04:25 +08:00
Fix bug in flatbuffer deserialization
Pull Request resolved: https://github.com/pytorch/pytorch/pull/78344 Approved by: https://github.com/qihqi
This commit is contained in:
committed by
PyTorch MergeBot
parent
f42b42d3eb
commit
7e72c96b10
@@ -16,6 +16,7 @@
|
||||
#include <torch/csrc/jit/mobile/module.h>
|
||||
#include <torch/csrc/jit/mobile/parse_bytecode.h>
|
||||
#include <torch/csrc/jit/mobile/parse_operators.h>
|
||||
#include <torch/csrc/jit/operator_upgraders/upgraders.h>
|
||||
#include <torch/csrc/jit/serialization/export.h>
|
||||
#include <torch/csrc/jit/serialization/export_bytecode.h>
|
||||
#include <torch/csrc/jit/serialization/flatbuffer_serializer.h>
|
||||
@@ -837,6 +838,7 @@ TEST(FlatbufferTest, DuplicateSetState) {
|
||||
|
||||
auto buff = save_mobile_module_to_bytes(bc);
|
||||
mobile::Module bc2 = parse_mobile_module(buff.data(), buff.size());
|
||||
ASSERT_TRUE(torch::jit::is_upgraders_map_populated());
|
||||
const auto methods2 = bc.get_methods();
|
||||
ASSERT_EQ(methods2.size(), expected_n);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user