summaryrefslogtreecommitdiff
path: root/c10
diff options
context:
space:
mode:
authorJerry Zhang <jerryzh@fb.com>2019-04-02 20:54:28 -0700
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>2019-04-02 21:03:37 -0700
commit40a54bf2f1b76f844b28c2fc084e0f58d6ebbc90 (patch)
tree8c4ec99d3e7ce9bf6aed9cc488cb63b6db756c3a /c10
parent80404cb2f516ff16cefbbf9270b2003a6213b29d (diff)
downloadpytorch-40a54bf2f1b76f844b28c2fc084e0f58d6ebbc90.tar.gz
pytorch-40a54bf2f1b76f844b28c2fc084e0f58d6ebbc90.tar.bz2
pytorch-40a54bf2f1b76f844b28c2fc084e0f58d6ebbc90.zip
Change ReinitializeTensor to use C10_LOG_FIRST_N (#18531)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/18531 Currently we use C10_LOG_EVERY_MS to log the data type change, but it pollutes the log of some service, we would like to change it to C10_LOG_FIRST_N to prevent that. Reviewed By: dzhulgakov Differential Revision: D14647704 fbshipit-source-id: b84e4002bd4aa94d616133cd1049c3d4ab05386e
Diffstat (limited to 'c10')
-rw-r--r--c10/util/Logging.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/c10/util/Logging.h b/c10/util/Logging.h
index 2d39d2125e..5833f355c8 100644
--- a/c10/util/Logging.h
+++ b/c10/util/Logging.h
@@ -40,6 +40,13 @@ C10_DECLARE_bool(caffe2_use_fatal_for_enforce);
#define C10_LOG_EVERY_MS(severity, ms) LOG(severity)
#endif
+// Same for LOG_FIRST_N
+#ifdef LOG_FIRST_N
+#define C10_LOG_FIRST_N(severity, n) LOG_FIRST_N(severity, n)
+#else
+#define C10_LOG_FIRST_N(severity, n) LOG(severity)
+#endif
+
namespace c10 {
using std::string;