torch/deploy,package: log usage for InterpreterManager, PackageExporter, PackageImporter (#77097)

Summary: This adds logs for usage of deploy and package. These can be used to track where it's being used in production so we can support it better.

Test Plan: no functional changes - existing tests

Reviewed By: PaliC

Differential Revision: D36258876

Pull Request resolved: https://github.com/pytorch/pytorch/pull/77097
Approved by: https://github.com/PaliC
This commit is contained in:
Tristan Rice
2022-05-10 19:26:44 +00:00
committed by PyTorch MergeBot
parent 64b543434d
commit 4d30ebc82a
3 changed files with 6 additions and 0 deletions

View File

@ -197,6 +197,8 @@ class PackageExporter:
importer: If a single Importer is passed, use that to search for modules.
If a sequence of importers are passsed, an ``OrderedImporter`` will be constructed out of them.
"""
torch._C._log_api_usage_once("torch.package.PackageExporter")
if isinstance(f, (Path, str)):
f = str(f)
self.buffer: Optional[BinaryIO] = None