From 80e3081c28c1a235602c2e9858335851c31987ac Mon Sep 17 00:00:00 2001 From: wuhuikx Date: Thu, 27 Sep 2018 13:56:53 -0700 Subject: 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 --- caffe2/ideep/utils/ideep_operator.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'caffe2/ideep') 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; -- cgit v1.2.3