mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[pytorch] add header docs for TORCH_LIBRARY_THREAD_UNSAFE_LAZY_INIT (#150854)
Summary: Add header docs for the experimental TORCH_LIBRARY_THREAD_UNSAFE_LAZY_INIT feature, and guard behind C10_MOBILE. Reviewed By: albanD Differential Revision: D72572345 Pull Request resolved: https://github.com/pytorch/pytorch/pull/150854 Approved by: https://github.com/larryliu0820, https://github.com/zou3519
This commit is contained in:
committed by
PyTorch MergeBot
parent
142f0f86ce
commit
64ac41f68d
@ -647,7 +647,7 @@ mobile::Module _load_for_mobile(
|
||||
std::optional<at::Device> device,
|
||||
ExtraFilesMap& extra_files,
|
||||
uint64_t module_load_options) {
|
||||
#ifdef TORCH_LIBRARY_THREAD_UNSAFE_LAZY_INIT
|
||||
#if defined(TORCH_LIBRARY_THREAD_UNSAFE_LAZY_INIT) && defined(C10_MOBILE)
|
||||
torch::initialize_torch_libraries();
|
||||
#endif
|
||||
auto observer = torch::observerConfig().getModuleObserver();
|
||||
|
Reference in New Issue
Block a user