Skip to content

Commit

Permalink
Clean Up MobileOptimizerType Rewrite Flags Public API and Documentation
Browse files Browse the repository at this point in the history
Summary:
X-link: pytorch/pytorch#91600

Pull Request resolved: #452

bypass-github-export-checks

Remove MobileOptimizerType and all rewrite flags from torch.X and torch._C.X to clean up torch.X and torch._C.X namespaces

The affected rewrite flags are
- CONV_BN_FUSION
- FUSE_ADD_RELU
- HOIST_CONV_PACKED_PARAMS
- INSERT_FOLD_PREPACK_OPS
- REMOVE_DROPOUT
- VULKAN_AUTOMATIC_GPU_TRANSFER

Bc-Breaking Change:

Before this change, the rewrite flags were accessible through all of
1. torch.utils.mobile_optimizer.MobileOptimizerType.X
2. torch._C.MobileOptimizerType.X
3. torch.X
4. torch.MobileOptimizerType.X
5. torch._C.X

But after this change, only torch.utils.mobile_optimizer.MobileOptimizerType.X  (option 1 above) and the newly added torch._C._MobileOptimizerType.X remain

Corresponding updates to PyTorch Tutorial Docs are in pytorch/tutorials#2163

Reviewed By: kimishpatel

Differential Revision: D41690203

fbshipit-source-id: 5c024d58dc6743a25832992d7a72af3d2cee1614
  • Loading branch information
salilsdesai authored and facebook-github-bot committed Jan 10, 2023
1 parent c688c17 commit a991738
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions d2go/export/torchscript.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@
from mobile_cv.common.misc.file_utils import make_temp_directory
from mobile_cv.common.misc.iter_utils import recursive_iterate
from torch import nn
from torch._C import MobileOptimizerType
from torch.utils.bundled_inputs import augment_model_with_bundled_inputs
from torch.utils.mobile_optimizer import optimize_for_mobile
from torch.utils.mobile_optimizer import MobileOptimizerType, optimize_for_mobile


logger = logging.getLogger(__name__)
Expand Down

0 comments on commit a991738

Please sign in to comment.