#pragma once #include #include #include #include namespace torch::jit::mobile { using Stack = std::vector; using DebugHandle = int64_t; class Function; // NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init) struct Code { std::vector instructions_; std::vector debug_handles_; std::vector op_names_; std::vector operator_input_sizes_; std::vector> operators_; std::vector constants_; std::vector types_; // TODO After we actually export CALL instructions we can remove this. // We may need a two-stage importing scheme, where we firstly construct all // function objects, and then append referenced function pointers. This could // be done in parseMethods(). std::vector functions_; size_t register_size_ = 0; // Aggregated output size. // initialized means operators_ array is filled with operators bool initialized = false; }; } // namespace torch::jit::mobile