Skip to content

Commit

Permalink
[GPU] Add an attribute to the torchscript model exported by metal (#4…
Browse files Browse the repository at this point in the history
…7174)

Summary:
Pull Request resolved: #47174

As title
ghstack-source-id: 115747991

Test Plan: Sandcastle

Reviewed By: kimishpatel

Differential Revision: D24616430

fbshipit-source-id: 2ccd264688471788f0dfea8bdc234fa69d39817f
  • Loading branch information
xta0 authored and facebook-github-bot committed Nov 3, 2020
1 parent 0ead9d5 commit ad3a3bd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions torch/csrc/jit/passes/metal_rewrite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@ script::Module metalOptimizeForMobile(
metalFoldPrePackingOps(cloned_module);
metalInsertCopyOps(cloned_module);
removeDropout(cloned_module);
cloned_module.register_attribute(
"optimized_for_metal", BoolType::get(), true);
return cloned_module;
}

Expand Down

0 comments on commit ad3a3bd

Please sign in to comment.