保存以下内容为print_cuda_arch.cu
#include <cstdio>
#define STR_HELPER(x) #x
#define STR(x) STR_HELPER(x)
__device__ void print_arch(){
const char my_compile_time_arch[] = STR(__CUDA_ARCH__);
printf("__CUDA_ARCH__: %s\n", my_compile_time_arch);
保存以下内容为print_cuda_arch.cu
#include <cstdio>
#define STR_HELPER(x) #x
#define STR(x) STR_HELPER(x)
__device__ void print_arch(){
const char my_compile_time_arch[] = STR(__CUDA_ARCH__);
printf("__CUDA_ARCH__: %s\n", my_compile_time_arch);
Docker这部分设置是继承主机的,因此以下流程需要在host侧去执行(需要管理员权限的,放弃吧!)
由于linux系统允许用户监控文件的数量是有限制的,所以导致vscode无法监控文件数量很多的代码库,因此需要单独设置一下。
from multiprocessing import Pool | |
import numpy as np | |
import torch | |
import torch.nn as nn | |
torch.multiprocessing.set_start_method('forkserver', force=True) | |
# torch.multiprocessing.set_start_method('spawn') | |
def random_size(): | |
""" |
// ==UserScript== | |
// @name Overleaf Editor VIM Keybindings settings | |
// @description Vim-mode in overleaf | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1.1 | |
// @match https://www.overleaf.com/project/* | |
// @match https://cn.overleaf.com/project/* | |
// @grant none | |
// Source 1: https://groups.google.com/d/msg/ace-discuss/gwXMzUM17I4/9B_acHBSCQAJ | |
// Source 2: https://www.overleaf.com/learn/how-to/How_can_I_define_custom_Vim_macros_in_a_vimrc_file_on_Overleaf%3F |
// ==UserScript== | |
// @name 樱花动漫去广告 | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1.3 | |
// @description 去除樱花动漫的广告,包括左侧、右侧、右下角、红包页面。未去除暂停界面的广告。(Safari不可用,原因未知) | |
// @author Roxbili | |
// @include *://*yhdm* | |
// @include *://*yinghuacd* | |
// @include *://*imomoe* | |
// @include *://*sakuradm* |
List
list1, list2 = (list(t) for t in zip(*sorted(zip(list1, list2))))
Numpy
people = ['Jim', 'Pam', 'Micheal', 'Dwight']
ages = [27, 25, 4, 9]