/
usr
/
local
/
lib64
/
python3.6
/
site-packages
/
torch
/
include
/
c10
/
util
/
/usr/local/lib64/python3.6/site-packages/torch/include/c10/util
mkdir
upload
Name
Size
Mode
Actions
accumulate.h
4205
0644
edit
dl
rm
AlignOf.h
4835
0644
edit
dl
rm
Array.h
11354
0644
edit
dl
rm
ArrayRef.h
9058
0644
edit
dl
rm
Backtrace.h
364
0644
edit
dl
rm
BFloat16-inl.h
9222
0644
edit
dl
rm
BFloat16-math.h
5217
0644
edit
dl
rm
BFloat16.h
2372
0644
edit
dl
rm
Bitset.h
3414
0644
edit
dl
rm
C++17.h
13329
0644
edit
dl
rm
complex.h
17542
0644
edit
dl
rm
complex_math.h
10902
0644
edit
dl
rm
complex_utils.h
958
0644
edit
dl
rm
ConstexprCrc.h
6633
0644
edit
dl
rm
copysign.h
866
0644
edit
dl
rm
DeadlockDetection.h
1920
0644
edit
dl
rm
Deprecated.h
3579
0644
edit
dl
rm
either.h
6423
0644
edit
dl
rm
env.h
835
0644
edit
dl
rm
Exception.h
24723
0644
edit
dl
rm
ExclusivelyOwned.h
4759
0644
edit
dl
rm
Flags.h
10056
0644
edit
dl
rm
flat_hash_map.h
61655
0644
edit
dl
rm
FunctionRef.h
2301
0644
edit
dl
rm
Half-inl.h
8674
0644
edit
dl
rm
Half.h
18965
0644
edit
dl
rm
hash.h
5084
0644
edit
dl
rm
IdWrapper.h
2348
0644
edit
dl
rm
intrusive_ptr.h
35563
0644
edit
dl
rm
in_place.h
350
0644
edit
dl
rm
irange.h
2679
0644
edit
dl
rm
LeftRight.h
6016
0644
edit
dl
rm
llvmMathExtras.h
29168
0644
edit
dl
rm
Logging.h
11256
0644
edit
dl
rm
logging_is_google_glog.h
2031
0644
edit
dl
rm
logging_is_not_google_glog.h
8271
0644
edit
dl
rm
MathConstants.h
858
0644
edit
dl
rm
math_compat.h
7296
0644
edit
dl
rm
MaybeOwned.h
6689
0644
edit
dl
rm
Metaprogramming.h
15288
0644
edit
dl
rm
numa.h
696
0644
edit
dl
rm
Optional.h
35592
0644
edit
dl
rm
order_preserving_flat_hash_map.h
65482
0644
edit
dl
rm
overloaded.h
709
0644
edit
dl
rm
python_stub.h
56
0644
edit
dl
rm
qint8.h
472
0644
edit
dl
rm
qint32.h
319
0644
edit
dl
rm
quint4x2.h
366
0644
edit
dl
rm
quint8.h
320
0644
edit
dl
rm
Registry.h
12242
0644
edit
dl
rm
reverse_iterator.h
8796
0644
edit
dl
rm
ScopeExit.h
1345
0644
edit
dl
rm
signal_handler.h
3154
0644
edit
dl
rm
SmallBuffer.h
1243
0644
edit
dl
rm
SmallVector.h
34456
0644
edit
dl
rm
sparse_bitset.h
26511
0644
edit
dl
rm
StringUtil.h
4538
0644
edit
dl
rm
string_utils.h
3989
0644
edit
dl
rm
string_view.h
20189
0644
edit
dl
rm
tempfile.h
6029
0644
edit
dl
rm
ThreadLocal.h
3883
0644
edit
dl
rm
ThreadLocalDebugInfo.h
2603
0644
edit
dl
rm
thread_name.h
148
0644
edit
dl
rm
Type.h
607
0644
edit
dl
rm
TypeCast.h
6972
0644
edit
dl
rm
typeid.h
18793
0644
edit
dl
rm
TypeIndex.h
5251
0644
edit
dl
rm
TypeList.h
16901
0644
edit
dl
rm
TypeTraits.h
5368
0644
edit
dl
rm
Unicode.h
295
0644
edit
dl
rm
UniqueVoidPtr.h
4117
0644
edit
dl
rm
Unroll.h
667
0644
edit
dl
rm
variant.h
95182
0644
edit
dl
rm
win32-headers.h
858
0644
edit
dl
rm
Edit:
/usr/local/lib64/python3.6/site-packages/torch/include/c10/util/logging_is_not_google_glog.h
(8271B)
#ifndef C10_UTIL_LOGGING_IS_NOT_GOOGLE_GLOG_H_ #define C10_UTIL_LOGGING_IS_NOT_GOOGLE_GLOG_H_ #include <chrono> #include <climits> #include <ctime> #include <fstream> #include <iomanip> #include <map> #include <set> #include <sstream> #include <string> #include <vector> #include <c10/util/Flags.h> const char CAFFE2_SEVERITY_PREFIX[] = "FEWIV"; namespace c10 { // Log severity level constants. const int GLOG_FATAL = 3; const int GLOG_ERROR = 2; const int GLOG_WARNING = 1; const int GLOG_INFO = 0; class C10_API MessageLogger { public: MessageLogger(const char* file, int line, int severity); ~MessageLogger(); // Return the stream associated with the logger object. std::stringstream& stream() { return stream_; } private: // When there is a fatal log, we simply abort. void DealWithFatal() { abort(); } const char* tag_; std::stringstream stream_; int severity_; }; // This class is used to explicitly ignore values in the conditional // logging macros. This avoids compiler warnings like "value computed // is not used" and "statement has no effect". class C10_API LoggerVoidify { public: LoggerVoidify() {} // This has to be an operator with a precedence lower than << but // higher than ?: void operator&(const std::ostream& s) {} }; // Log a message and terminate. template <class T> void LogMessageFatal(const char* file, int line, const T& message) { MessageLogger(file, line, GLOG_FATAL).stream() << message; } // Helpers for CHECK_NOTNULL(). Two are necessary to support both raw pointers // and smart pointers. template <typename T> T& CheckNotNullCommon(const char* file, int line, const char* names, T& t) { if (t == nullptr) { LogMessageFatal(file, line, std::string(names)); } return t; } template <typename T> T* CheckNotNull(const char* file, int line, const char* names, T* t) { return CheckNotNullCommon(file, line, names, t); } template <typename T> T& CheckNotNull(const char* file, int line, const char* names, T& t) { return CheckNotNullCommon(file, line, names, t); } } // namespace c10 // ---------------------- Logging Macro definitions -------------------------- static_assert( CAFFE2_LOG_THRESHOLD <= ::c10::GLOG_FATAL, "CAFFE2_LOG_THRESHOLD should at most be GLOG_FATAL."); // If n is under the compile time caffe log threshold, The _CAFFE_LOG(n) // should not generate anything in optimized code. #define LOG(n) \ if (::c10::GLOG_##n >= CAFFE2_LOG_THRESHOLD) \ ::c10::MessageLogger((char*)__FILE__, __LINE__, ::c10::GLOG_##n).stream() #define VLOG(n) \ if (-n >= CAFFE2_LOG_THRESHOLD) \ ::c10::MessageLogger((char*)__FILE__, __LINE__, -n).stream() #define LOG_IF(n, condition) \ if (::c10::GLOG_##n >= CAFFE2_LOG_THRESHOLD && (condition)) \ ::c10::MessageLogger((char*)__FILE__, __LINE__, ::c10::GLOG_##n).stream() #define VLOG_IF(n, condition) \ if (-n >= CAFFE2_LOG_THRESHOLD && (condition)) \ ::c10::MessageLogger((char*)__FILE__, __LINE__, -n).stream() #define VLOG_IS_ON(verboselevel) (CAFFE2_LOG_THRESHOLD <= -(verboselevel)) // Log with source location information override (to be used in generic // warning/error handlers implemented as functions, not macros) #define LOG_AT_FILE_LINE(n, file, line) \ if (::c10::GLOG_##n >= CAFFE2_LOG_THRESHOLD) \ ::c10::MessageLogger(file, line, ::c10::GLOG_##n).stream() // Log only if condition is met. Otherwise evaluates to void. #define FATAL_IF(condition) \ condition ? (void)0 \ : ::c10::LoggerVoidify() & \ ::c10::MessageLogger((char*)__FILE__, __LINE__, ::c10::GLOG_FATAL) \ .stream() // Check for a given boolean condition. #define CHECK(condition) FATAL_IF(condition) << "Check failed: " #condition " " #ifndef NDEBUG // Debug only version of CHECK #define DCHECK(condition) FATAL_IF(condition) << "Check failed: " #condition " " #else // Optimized version - generates no code. #define DCHECK(condition) \ while (false) \ CHECK(condition) #endif // NDEBUG #define CHECK_OP(val1, val2, op) \ FATAL_IF(((val1)op(val2))) << "Check failed: " #val1 " " #op " " #val2 " (" \ << (val1) << " vs. " << (val2) << ") " // Check_op macro definitions #define CHECK_EQ(val1, val2) CHECK_OP(val1, val2, ==) #define CHECK_NE(val1, val2) CHECK_OP(val1, val2, !=) #define CHECK_LE(val1, val2) CHECK_OP(val1, val2, <=) #define CHECK_LT(val1, val2) CHECK_OP(val1, val2, <) #define CHECK_GE(val1, val2) CHECK_OP(val1, val2, >=) #define CHECK_GT(val1, val2) CHECK_OP(val1, val2, >) #ifndef NDEBUG // Debug only versions of CHECK_OP macros. #define DCHECK_EQ(val1, val2) CHECK_OP(val1, val2, ==) #define DCHECK_NE(val1, val2) CHECK_OP(val1, val2, !=) #define DCHECK_LE(val1, val2) CHECK_OP(val1, val2, <=) #define DCHECK_LT(val1, val2) CHECK_OP(val1, val2, <) #define DCHECK_GE(val1, val2) CHECK_OP(val1, val2, >=) #define DCHECK_GT(val1, val2) CHECK_OP(val1, val2, >) #else // !NDEBUG // These versions generate no code in optimized mode. #define DCHECK_EQ(val1, val2) \ while (false) \ CHECK_OP(val1, val2, ==) #define DCHECK_NE(val1, val2) \ while (false) \ CHECK_OP(val1, val2, !=) #define DCHECK_LE(val1, val2) \ while (false) \ CHECK_OP(val1, val2, <=) #define DCHECK_LT(val1, val2) \ while (false) \ CHECK_OP(val1, val2, <) #define DCHECK_GE(val1, val2) \ while (false) \ CHECK_OP(val1, val2, >=) #define DCHECK_GT(val1, val2) \ while (false) \ CHECK_OP(val1, val2, >) #endif // NDEBUG // Check that a pointer is not null. #define CHECK_NOTNULL(val) \ ::c10::CheckNotNull( \ __FILE__, __LINE__, "Check failed: '" #val "' Must be non NULL", (val)) #ifndef NDEBUG // Debug only version of CHECK_NOTNULL #define DCHECK_NOTNULL(val) \ ::c10::CheckNotNull( \ __FILE__, __LINE__, "Check failed: '" #val "' Must be non NULL", (val)) #else // !NDEBUG // Optimized version - generates no code. #define DCHECK_NOTNULL(val) \ while (false) \ CHECK_NOTNULL(val) #endif // NDEBUG // ---------------------- Support for std objects -------------------------- // These are adapted from glog to support a limited set of logging capability // for STL objects. namespace std { // Forward declare these two, and define them after all the container streams // operators so that we can recurse from pair -> container -> container -> pair // properly. template <class First, class Second> std::ostream& operator<<(std::ostream& out, const std::pair<First, Second>& p); } // namespace std namespace c10 { template <class Iter> void PrintSequence(std::ostream& ss, Iter begin, Iter end); } // namespace c10 namespace std { #define INSTANTIATE_FOR_CONTAINER(container) \ template <class... Types> \ std::ostream& operator<<( \ std::ostream& out, const container<Types...>& seq) { \ c10::PrintSequence(out, seq.begin(), seq.end()); \ return out; \ } INSTANTIATE_FOR_CONTAINER(std::vector) INSTANTIATE_FOR_CONTAINER(std::map) INSTANTIATE_FOR_CONTAINER(std::set) #undef INSTANTIATE_FOR_CONTAINER template <class First, class Second> inline std::ostream& operator<<( std::ostream& out, const std::pair<First, Second>& p) { out << '(' << p.first << ", " << p.second << ')'; return out; } inline std::ostream& operator<<(std::ostream& out, const std::nullptr_t&) { out << "(null)"; return out; } } // namespace std namespace c10 { template <class Iter> inline void PrintSequence(std::ostream& out, Iter begin, Iter end) { // Output at most 100 elements -- appropriate if used for logging. for (int i = 0; begin != end && i < 100; ++i, ++begin) { if (i > 0) out << ' '; out << *begin; } if (begin != end) { out << " ..."; } } } // namespace c10 #endif // C10_UTIL_LOGGING_IS_NOT_GOOGLE_GLOG_H_
Save
cmd:
run