@@ -599,7 +599,7 @@ void runAndCheckTorchScriptModel(
599
599
std::stringstream& input_model_stream,
600
600
const std::vector<IValue>& input_data,
601
601
const std::vector<IValue>& expect_result_list,
602
- const int64_t expect_version) {
602
+ const uint64_t expect_version) {
603
603
auto actual_version = _get_model_bytecode_version (input_model_stream);
604
604
AT_ASSERT (actual_version == expect_version);
605
605
@@ -616,7 +616,7 @@ void runAndCheckBytecodeModel(
616
616
std::stringstream& input_model_stream,
617
617
const std::vector<IValue>& input_data,
618
618
const std::vector<IValue>& expect_result_list,
619
- const int64_t expect_version) {
619
+ const uint64_t expect_version) {
620
620
auto actual_version = _get_model_bytecode_version (input_model_stream);
621
621
AT_ASSERT (actual_version == expect_version);
622
622
@@ -634,13 +634,14 @@ void backportAllVersionCheck(
634
634
std::stringstream& test_model_file_stream,
635
635
std::vector<IValue>& input_data,
636
636
std::vector<IValue>& expect_result_list,
637
- const int64_t expect_from_version) {
637
+ const uint64_t expect_from_version) {
638
638
auto from_version = _get_model_bytecode_version (test_model_file_stream);
639
639
AT_ASSERT (from_version == expect_from_version);
640
+ AT_ASSERT (from_version > 0 );
640
641
641
642
// Backport script_module_v5.ptl to an older version
642
643
constexpr int64_t minimum_to_version = 4 ;
643
- int64_t current_to_version = from_version - 1 ;
644
+ auto current_to_version = from_version - 1 ;
644
645
645
646
// Verify all candidate to_version work as expected. All backport to version
646
647
// larger than minimum_to_version should success.
0 commit comments