File: 2050-pytorch_glog_update.patch

package info (click to toggle)
pytorch-cuda 2.6.0%2Bdfsg-7
  • links: PTS, VCS
  • area: contrib
  • in suites: forky, sid, trixie
  • size: 161,620 kB
  • sloc: python: 1,278,832; cpp: 900,322; ansic: 82,710; asm: 7,754; java: 3,363; sh: 2,811; javascript: 2,443; makefile: 597; ruby: 195; xml: 84; objc: 68
file content (38 lines) | stat: -rw-r--r-- 1,309 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
Description: move IsGoogleLoggingInitialized() to public API
 It was an internal function and project used hacks to reach it. Now it's part
 of the public API.
Author: Laszlo Boszormenyi (GCS) <gcs@debian.org>
Forwarded: not-needed
Last-Update: 2022-03-08

---

Index: pytorch/c10/util/Logging.cpp
===================================================================
--- pytorch.orig/c10/util/Logging.cpp
+++ pytorch/c10/util/Logging.cpp
@@ -296,23 +296,13 @@ C10_DEFINE_int(
     google::GLOG_WARNING,
     "The minimum log level that caffe2 will output.");
 
-// Google glog's api does not have an external function that allows one to check
-// if glog is initialized or not. It does have an internal function - so we are
-// declaring it here. This is a hack but has been used by a bunch of others too
-// (e.g. Torch).
-namespace google {
-namespace glog_internal_namespace_ {
-bool IsGoogleLoggingInitialized();
-} // namespace glog_internal_namespace_
-} // namespace google
-
 namespace c10 {
 namespace {
 
 void initGoogleLogging(char const* name) {
 #if !defined(_MSC_VER)
   // This trick can only be used on UNIX platforms
-  if (!::google::glog_internal_namespace_::IsGoogleLoggingInitialized())
+  if (!::google::IsGoogleLoggingInitialized())
 #endif
   {
     ::google::InitGoogleLogging(name);