Whether the type is a specialization of template T
.
template class T, typename U>
# Detect operating system in Makefile. | |
# Author: He Tao | |
# Date: 2015-05-30 | |
OSFLAG := | |
ifeq ($(OS),Windows_NT) | |
OSFLAG += -D WIN32 | |
ifeq ($(PROCESSOR_ARCHITECTURE),AMD64) | |
OSFLAG += -D AMD64 | |
endif |
class GPTModel: | |
def __init__( | |
self, | |
name: str = None, | |
vocab_size: int = 51200, | |
sequence_length: int = 2048, | |
attention_heads: int = 32, | |
hidden_size: int = 2304, | |
layers: int = 24, | |
micro_batch_size: int = 1, |
cat /proc/config.gz | gunzip |
template <typename U> | |
struct A_trait { | |
using T = int; | |
}; | |
template <typename U, template <typename ...> class Trait = A_trait> | |
struct A { | |
using T = typename Trait<U>::T; | |
}; |
# Get all propreties that cmake supports | |
if(NOT CMAKE_PROPERTY_LIST) | |
execute_process(COMMAND cmake --help-property-list OUTPUT_VARIABLE CMAKE_PROPERTY_LIST) | |
# Convert command output into a CMake list | |
string(REGEX REPLACE ";" "\\\\;" CMAKE_PROPERTY_LIST "${CMAKE_PROPERTY_LIST}") | |
string(REGEX REPLACE "\n" ";" CMAKE_PROPERTY_LIST "${CMAKE_PROPERTY_LIST}") | |
endif() | |
list(APPEND CMAKE_PROPERTY_LIST "IMPORTED_LOCATION") |
function(print_cmake_variables) | |
get_cmake_property(_variableNames VARIABLES) | |
list (SORT _variableNames) | |
foreach (_variableName ${_variableNames}) | |
if (ARGV0) | |
unset(MATCHED) | |
string(REGEX MATCH ${ARGV0} MATCHED ${_variableName}) | |
if (NOT MATCHED) | |
continue() | |
endif() |
macro(find_openssl_libraries) | |
if (APPLE) | |
# If we're on OS X check for Homebrew's copy of OpenSSL instead of Apple's | |
if (NOT OpenSSL_DIR) | |
find_program(HOMEBREW brew) | |
if (HOMEBREW STREQUAL "HOMEBREW-NOTFOUND") | |
message(WARNING "Homebrew not found: not using Homebrew's OpenSSL") | |
if (NOT OPENSSL_ROOT_DIR) | |
message(WARNING "Use -DOPENSSL_ROOT_DIR for non-Apple OpenSSL") | |
endif() |