- 博客(11)
- 收藏
- 关注
原创 运行make ARCH=native run mainargs=mario后,出现错误:
glibc2.34更新后,SIGSTKSZ由常数变成了const变量。
2023-05-11 20:29:24 132
原创 南大ics llvm/Support/TargetRegistry.h: No such file or directory
【代码】南大ics llvm/Support/TargetRegistry.h: No such file or directory。
2023-05-09 21:09:32 180
原创 python 驻留机制
>>> s1 = '111'>>> s2 = '111'>>> s3 = "111">>> id(s1)2385244511728>>> id(s2) 2385244511728>>> id(s3) 2385244511728>>> s4 = '''111''' >>> id(s4)2385244511728但是>>>
2022-04-23 16:13:09 634
原创 python 二维list
由于python副本是浅拷贝;不复制嵌套结构。采用[[0] * 5] * 3时:[0]*5不会出现问题但由于[[0] * 5]中最外层list存储的是[0]*5的引用,复制3次后,每一层都会引用[0]*5,改变一个别的也会变。>>> a = [[0]*5]*3>>> a[0][0]=3>>> a[[3, 0, 0, 0, 0], [3, 0, 0, 0, 0], [3, 0, 0, 0, 0]]构建二维list时应当:>&g
2022-04-12 16:03:58 5001
原创 【python数据结构的哈希】
哈希不可哈希:可变的数据结构如 list,dict,set可哈希:数字、字符串、(只含数字、字符串的)touple>>> b{1: 2, 3: 4, 0: 1, 2: 1}>>> hash(b)Traceback (most recent call last): File "<stdin>", line 1, in <module>TypeError: unhashable type: 'dict'>>>.
2022-04-08 20:50:05 1204
原创 pytorch,令代码在指定gpu上运行
所用服务器有四个卡0、1、2、3,想指定代码在2卡上运行。不知道为啥,用import osos.environ['CUDA_VISIBLE_DEVICES'] = '2'和export CUDA_VISIBLE_DEVICES= 2最后用nvidia-smi看代码都在0卡上跑。。最终解决:import torchtorch.cuda.set_device(1)我刚开始改成只用torch,会提示我设备号不存在,加上os之后可以执行,后来又试了几次删掉os,也可以执行???费解.
2020-08-13 21:34:10 958
原创 对元素排序并取前n小值的index
ipdb> m array([[ 3, 3, 3, 15], [ 3, 18, 17, 16], [ 5, 12, 17, 10]])ipdb> np.argsort(m, axis = 0)
2020-07-24 22:10:03 90
原创 Anaconda 安装指定版本包
Anaconda 安装指定版本包//搜索包,查看可安装版本conda search XXX//安装conda install XXX==2.7.1
2020-05-15 17:10:46 4754
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人