diff options
author | wuhuikx <hui.h.wu@intel.com> | 2018-09-27 13:56:53 -0700 |
---|---|---|
committer | Facebook Github Bot <facebook-github-bot@users.noreply.github.com> | 2018-09-27 14:11:19 -0700 |
commit | 80e3081c28c1a235602c2e9858335851c31987ac (patch) | |
tree | 414588a05392ff0eed0357ea3039b016c83252db /caffe2/ideep | |
parent | 6e7e63fda3a4ee1254a17480692b93148954b8b9 (diff) | |
download | pytorch-80e3081c28c1a235602c2e9858335851c31987ac.tar.gz pytorch-80e3081c28c1a235602c2e9858335851c31987ac.tar.bz2 pytorch-80e3081c28c1a235602c2e9858335851c31987ac.zip |
Add observers for mkldnn fallback operators (#9093)
Summary:
Add observers for ideep operators.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/9093
Reviewed By: salexspb
Differential Revision: D9952949
Pulled By: yinghai
fbshipit-source-id: 1678d1a738f8781dc75eb3cb9dfb309f7b7934fb
Diffstat (limited to 'caffe2/ideep')
-rw-r--r-- | caffe2/ideep/utils/ideep_operator.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/caffe2/ideep/utils/ideep_operator.h b/caffe2/ideep/utils/ideep_operator.h index 89e0691c29..f9b6a83106 100644 --- a/caffe2/ideep/utils/ideep_operator.h +++ b/caffe2/ideep/utils/ideep_operator.h @@ -51,7 +51,10 @@ class IDEEPOperator : public OperatorBase { // FinishDeviceComputation, // it is always just a re-route to RunOnDevice(). try { - return RunOnDevice(); + StartAllObservers(); + bool result = RunOnDevice(); + StopAllObservers(); + return result; } catch (EnforceNotMet& err) { err.AppendMessage(getErrorMsg()); throw; |