pytorch
9ba9a167 - [PyTorch Edge] Use stream as backport_vi_to_vi-1 interface (#58790)

Commit
3 years ago
[PyTorch Edge] Use stream as backport_vi_to_vi-1 interface (#58790) Summary: Two main changes: 1. Change the argument of the collection of backport_v{i}_to_v{i-1} from (reader, writer) to (input_model_stream, output_model_stream), so it's easier to backport a model in option 2. > 2) [Both format and content change] ]Use torch.jit.load() to load the stream, and save it to output_model_stream. 2. Fix an issue in the test `backportAllVersionCheck`. Previous it declares `std::ostringstream oss` and uses `oss.clear()` to reset the stringstream. However, the `clear()` function doesn't reset the stream content, and causes problematic stream. As a mitigation, checks are added to prevent corrupted stream for each iteration in while loop. Pull Request resolved: https://github.com/pytorch/pytorch/pull/58790 ghstack-source-id: 129929960 Test Plan: CI ``` buck test mode/dev //caffe2/test/cpp/jit:jit ``` Reviewed By: raziel, iseeyuan Differential Revision: D28620961 fbshipit-source-id: b0cbe0e88645ae278eb3999e2a84800702b5f985
Author
Parents
Loading