mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/65972 ghstack-source-id: 141842336 Test Plan: buck test mode/dev //caffe2/test:mobile -- --exact 'caffe2/test:mobile - test_stacktrace_interface_call (mobile.test_lite_script_module.TestLiteScriptModule)' Reviewed By: qihqi Differential Revision: D31326147 fbshipit-source-id: 338ff4ce8ddc9502ffe0add49057b33b52a24955
31 lines
688 B
C++
31 lines
688 B
C++
#pragma once
|
|
|
|
#include <vector>
|
|
|
|
#include <torch/csrc/jit/mobile/code.h>
|
|
#include <torch/csrc/jit/mobile/frame.h>
|
|
|
|
namespace torch {
|
|
namespace jit {
|
|
namespace mobile {
|
|
|
|
struct InterpreterState {
|
|
TORCH_API explicit InterpreterState(const Code& code);
|
|
TORCH_API bool run(Stack& stack);
|
|
|
|
private:
|
|
void enterFrame(const Code&);
|
|
void leaveFrame();
|
|
void saveExceptionDebugHandles();
|
|
void callFunction(torch::jit::Function& f, Stack& stack);
|
|
|
|
c10::IValue& reg(size_t reg);
|
|
std::vector<c10::IValue> registers_;
|
|
std::vector<Frame> frames_;
|
|
};
|
|
|
|
const std::vector<DebugHandle>& getInterpretersExceptionDebugHandles();
|
|
} // namespace mobile
|
|
} // namespace jit
|
|
} // namespace torch
|