pytorch
af9600b1 - [Caffe2] Move in-header virtual function implementation to .cc files (#41090)

Commit
5 years ago
[Caffe2] Move in-header virtual function implementation to .cc files (#41090) * Move OperatorSchema default inference function implementations to .cc… (#40845) Summary: … file This prevents implementation of those functions(as lambdas) to be embedded as weak symbol into every shared library that includes this header. Combination of this and https://github.com/pytorch/pytorch/pull/40844 reduces size of `libcaffe2_module_test_dynamic.so` from 500kb to 50Kb. Pull Request resolved: https://github.com/pytorch/pytorch/pull/40845 Differential Revision: D22334779 Pulled By: malfet fbshipit-source-id: 64706918fc2947350a58c0877f294b1b8b085455 * Move `OperatorBase::AddRelatedBlobInfo` implementation to .cc file (#40844) Summary: If virtual function is implemented in header file, it's implementation will be included as a weak symbol to every shared library that includes this header along with all of it's dependencies. This was one of the reasons why size of libcaffe2_module_test_dynamic.so was 500Kb (AddRelatedBlobInfo implementation pulled a quarter of libprotobuf.a with it) Combination of this and https://github.com/pytorch/pytorch/issues/40845 reduces size of `libcaffe2_module_test_dynamic.so` from 500kb to 50Kb. Pull Request resolved: https://github.com/pytorch/pytorch/pull/40844 Differential Revision: D22334725 Pulled By: malfet fbshipit-source-id: 836a4cbb9f344355ddd2512667e77472546616c0
Author
Parents
Loading