/usr/local/lib64/python3.6/site-packages/torch/include/c10/util
NameSizeModeActions
accumulate.h42050644editdlrm
AlignOf.h48350644editdlrm
Array.h113540644editdlrm
ArrayRef.h90580644editdlrm
Backtrace.h3640644editdlrm
BFloat16-inl.h92220644editdlrm
BFloat16-math.h52170644editdlrm
BFloat16.h23720644editdlrm
Bitset.h34140644editdlrm
C++17.h133290644editdlrm
complex.h175420644editdlrm
complex_math.h109020644editdlrm
complex_utils.h9580644editdlrm
ConstexprCrc.h66330644editdlrm
copysign.h8660644editdlrm
DeadlockDetection.h19200644editdlrm
Deprecated.h35790644editdlrm
either.h64230644editdlrm
env.h8350644editdlrm
Exception.h247230644editdlrm
ExclusivelyOwned.h47590644editdlrm
Flags.h100560644editdlrm
flat_hash_map.h616550644editdlrm
FunctionRef.h23010644editdlrm
Half-inl.h86740644editdlrm
Half.h189650644editdlrm
hash.h50840644editdlrm
IdWrapper.h23480644editdlrm
intrusive_ptr.h355630644editdlrm
in_place.h3500644editdlrm
irange.h26790644editdlrm
LeftRight.h60160644editdlrm
llvmMathExtras.h291680644editdlrm
Logging.h112560644editdlrm
logging_is_google_glog.h20310644editdlrm
logging_is_not_google_glog.h82710644editdlrm
MathConstants.h8580644editdlrm
math_compat.h72960644editdlrm
MaybeOwned.h66890644editdlrm
Metaprogramming.h152880644editdlrm
numa.h6960644editdlrm
Optional.h355920644editdlrm
order_preserving_flat_hash_map.h654820644editdlrm
overloaded.h7090644editdlrm
python_stub.h560644editdlrm
qint8.h4720644editdlrm
qint32.h3190644editdlrm
quint4x2.h3660644editdlrm
quint8.h3200644editdlrm
Registry.h122420644editdlrm
reverse_iterator.h87960644editdlrm
ScopeExit.h13450644editdlrm
signal_handler.h31540644editdlrm
SmallBuffer.h12430644editdlrm
SmallVector.h344560644editdlrm
sparse_bitset.h265110644editdlrm
StringUtil.h45380644editdlrm
string_utils.h39890644editdlrm
string_view.h201890644editdlrm
tempfile.h60290644editdlrm
ThreadLocal.h38830644editdlrm
ThreadLocalDebugInfo.h26030644editdlrm
thread_name.h1480644editdlrm
Type.h6070644editdlrm
TypeCast.h69720644editdlrm
typeid.h187930644editdlrm
TypeIndex.h52510644editdlrm
TypeList.h169010644editdlrm
TypeTraits.h53680644editdlrm
Unicode.h2950644editdlrm
UniqueVoidPtr.h41170644editdlrm
Unroll.h6670644editdlrm
variant.h951820644editdlrm
win32-headers.h8580644editdlrm
Edit: /usr/local/lib64/python3.6/site-packages/torch/include/c10/util/Metaprogramming.h (15288B)
#pragma once #include #include #include #include #include namespace c10 { namespace guts { /** * Access information about result type or arguments from a function type. * Example: * using A = function_traits::return_type // A == int * using A = function_traits::parameter_types::tuple_type * // A == tuple */ template struct function_traits { static_assert( !std::is_same::value, "In function_traits, Func must be a plain function type."); }; template struct function_traits { using func_type = Result(Args...); using return_type = Result; using parameter_types = typelist::typelist; static constexpr auto number_of_parameters = sizeof...(Args); }; /** * infer_function_traits: creates a `function_traits` type for a simple * function (pointer) or functor (lambda/struct). Currently does not support * class methods. */ template struct infer_function_traits { using type = function_traits< c10::guts::detail::strip_class_t>; }; template struct infer_function_traits { using type = function_traits; }; template struct infer_function_traits { using type = function_traits; }; template using infer_function_traits_t = typename infer_function_traits::type; /** * make_function_traits: creates a `function_traits` type given a Return type * and a typelist of Argument types * * Example: * bool f(int, int); * * infer_function_traits_t == make_function_traits_t> */ template struct make_function_traits { static_assert( false_t::value, "In guts::make_function_traits, the ArgList argument must be typelist<...>."); }; template struct make_function_traits> { using type = function_traits; }; template using make_function_traits_t = typename make_function_traits::type; /** * Use extract_arg_by_filtered_index to return the i-th argument whose * type fulfills a given type trait. The argument itself is perfectly forwarded. * * Example: * std::string arg1 = "Hello"; * std::string arg2 = "World"; * std::string&& result = extract_arg_by_filtered_index(0, * arg1, 2.0, std::move(arg2)); * * Warning: Taking the result by rvalue reference can cause segfaults because * ownership will not be passed on from the original reference. The original * reference dies after the expression and the resulting */ namespace detail { template < template class Condition, size_t index, class Enable, class... Args> struct extract_arg_by_filtered_index_; template < template class Condition, size_t index, class Head, class... Tail> struct extract_arg_by_filtered_index_< Condition, index, std::enable_if_t::value>, Head, Tail...> { static decltype(auto) call(Head&& /*head*/, Tail&&... tail) { return extract_arg_by_filtered_index_:: call(std::forward(tail)...); } }; template < template class Condition, size_t index, class Head, class... Tail> struct extract_arg_by_filtered_index_< Condition, index, std::enable_if_t::value && index != 0>, Head, Tail...> { static decltype(auto) call(Head&& /*head*/, Tail&&... tail) { return extract_arg_by_filtered_index_:: call(std::forward(tail)...); } }; template