pytorch/torch/csrc/jit/api
Nikita Shulga 8ddc549c0f [BE][JIT] Do not wrap shared_ptr with optional (#115473)
While reviewing https://github.com/pytorch/pytorch/pull/115381 noticed that `torch::jit::GraphFunction::optimized_graph_` is an `std::array<c10::optional<std::shared_ptr<Graph>>, N>`, which feels excessive as `shared_ptr` is already nullable and have `operator bool()`. Looking at https://github.com/pytorch/pytorch/pull/26488 that introduced the change, also does not hint that this indirection is necessary.

Test plan: CI

Pull Request resolved: https://github.com/pytorch/pytorch/pull/115473
Approved by: https://github.com/davidberard98, https://github.com/Skylion007
2023-12-09 20:43:40 +00:00
..
compilation_unit.h Fix typo in compilation_unit.h (#112572) 2023-11-02 08:26:59 +00:00
function_impl.cpp [BE][JIT] Do not wrap shared_ptr with optional (#115473) 2023-12-09 20:43:40 +00:00
function_impl.h [BE][JIT] Do not wrap shared_ptr with optional (#115473) 2023-12-09 20:43:40 +00:00
method.h [BE] [3/N] Use nested namespaces (#110314) 2023-09-30 02:23:48 +00:00
module_save.cpp [BE] Use nested namespaces in .cpp/.cu files (#92100) 2023-01-13 16:32:34 +00:00
module.cpp Fix optimize_for_inference to support modules that don't have a forward method (#110013) 2023-10-02 20:13:44 +00:00
module.h Make torch::jit::module movable (#114041) 2023-11-28 05:03:37 +00:00
object.cpp [BE] Use nested namespaces in .cpp/.cu files (#92100) 2023-01-13 16:32:34 +00:00
object.h Make torch::jit::module movable (#114041) 2023-11-28 05:03:37 +00:00