Definition

Tensor--"张量", actually it is a little bit like the vector to store numbers(linear algebra)

Operation

import torch

第一步永远是先导入torch库才能使用

0 Initializatin

  1. x = torch.empty(a, b) a rows and b columns of 0
  2. x = torch.random(a, b) a rows and b columns of random number
  3. x = torch.zeros(a, b, dtype = torch.long) use dtype to specify the type of the entries in tensor(in this case, type is long)
  4. x = torch.tensor([x1, x2, ...]) use square brackets to init the size/ values of a tensor
  5. y = torch.random_like(x, detype = torch.float) , _likemesans using an existing tensor to init another one(in this case, we use the size of the old tensor to create a new tensor with type float)
Read more »

之前一直是离线玩家,但是离线多周目之后确实无聊。然后买了个加速器去线上,快乐无穷啊,各种亲切老哥,特别是王子、校长、传火门前那是无数金光,快乐max!

1

问题描述

mac上vscode显示fail to save要求try as sudo

问题解决

当然你可以每次都手动输入一遍密码,但是太麻烦,而且也有可能失败 所以最好就是直接给vscode对当前文件夹的完全权限

sudo chown -R <usrname> </address>

more

chown表示权限 -R表示对子文件递推 但是要注意,每次在该文件下以vscode以外的终端新增的文件依然没有权限,重新进行一下命令就好了。

问题描述

  1. 已经在hexo/yilia主题内_config.yml中的avatar配置了路径
  2. root路径下配置_config.ymlpost_asset_folder: true 但是打开之后依然无法显示,甚至还有一个问号

问题解决

这里有一个很tricky的地方搞了我很久 在yilia主题下的_config.yml所配置的根目录不是/themes/yilia而是/themes/yilia/source 比如我所配置的路径/themes/yilia/source/assets/imags/avatar.png,那么在_config.yml中配置的路径就只能是/assets/imags/avatar.png

注意 麻烦的地方就在这里,全路径在deploy到服务器时会出现问题,很基础,但一定要注意。

使用hexo theme Butterfly 报错

直接用github上作者提供的代码

git clone -b master https://github.com/jerryc127/hexo-theme-butterfly.git themes/Butterfly

结果是页面根本无法正常渲染,只有一行字:

extends includes/layout.pug block content include ./includes/mixins/post-ui.pug #recent-posts.recent-posts +postUI include includes/pagination.pug

问题解决

参照原作者提供的文章Butterfly

按照方法安装npm install hexo-renderer-pug hexo-renderer-stylus --save然后打开


丝滑进入

环境

macOS:10.15 VScode:1.4 --- ## 问题描述 在macos下想给vscode加一个酷炫的毛玻璃效果,参考了炫酷的VS Code毛玻璃效果,但是实际操作中css文件并没有生效。 --- ## 问题解决 起哦一开始以为是mac恶心的权限问题,然后尝试给vscode权限,但是没有用。 然后我去看了git上原作者的说明:https://github.com/Microsoft/vscode/issues/32257 >Sorry. This method has failed after the vscode v1.36 update. The reason is that a black background color has been added to the window. And the Electron's setBackgroundColor() method has some bugs on the MacOS. I can't dynamically change the background color in the script. Now you can only modify the vscode source to enable the vibrant effect.

hi guys. I have some good news. The old way has failed after the vscode v1.36 update. I changed the custom.js file: w = nodeRequire('electron') .remote .getCurrentWindow(); w.setBackgroundColor('#00000000'); w.setVibrancy('ultra-dark'); w.setFullScreen(true); Don't forget to execute the command "Reload Custom CSS and JS". with automatic full screen vscode, the problem has been fixed. You can turn off full screen manually.

于是首先我尝试降级到1.5之前,事实上成功了。 然后我采取作者的说法,尝试修改.js文件,但是又不行了,vscode在1.3.7之后又有新的问题。 巧合的是我看到作者其实好像是个中国人,并且开发了一个vscode拓展。。。。 这TM就很尴尬,拓展一装就完事了,我其实定制化需求也不是很大

vibrancy

Note

此插件在windows下同样适用,并且可以自行去作者git上看说明。

问题描述

在按照网上随处找的ubuntu双系统安装教程安装ubuntu成功之后,重启,直接进入windows,完全没有引导,用easyBCD也只找到了window一个系统,反复尝试多次把ubuntu干掉重来之后依旧没有进步。

问题解决

本来人都傻了,这时忽然看到网上有人说安装ubuntu不能看那些太老的教程。 我想到是不是现在新的电脑bios的问题?于是赶紧进我的微星bios里面看发现自己的引导是UEFI+LEGACY,那应该bios也行啊。 但是我抱着试试的态度把它改成UEFI,可能有些主板要改这个比较麻烦,然后上网找了个UEFI引导的ubuntu安装教程。

然后就打开了,困扰了好几天的问题解决了。

More

注意在bios里面把第一启动项改为ubuntu,然后再打开。

因为ubuntu可以引导windows,但是要让windows引导ubuntu需要用easyuefi自行配置

这个问题很细节,但是同时也很恶心,反正就是要注意教程的环境和自己到底一不一样,还有就是要每一个设置的意义都要明白。

  1. hexo到git上部署首先要检查自己的config里的repo地址对不对

  2. 如果地址正确可以考虑在_config.yml的repo下面一行添加上

branch: master

问题描述

已经按照网上的教程把openmp安装好了,也已经配置了path,但是在实际使用的时候无法调用库

问题原因

原因应该和mac操作系统有关,mac自动将gcc指向clang,在实际使用的时候会出错 因此有一下三种解决办法:

  1. 手动link 这个可以考虑手动link库,去网上找就有了

  2. 手动打开preinterpreter

1
gcc -Xpreprocessor -fopenmp -lomp xxxx.c

  1. 重新为mac安装

1
pip install gcc

如果有了就更新一下

1
pip reinstall gcc

然后指名自己的gcc去运行(此方法来自助教,可以有效解决很多mac上gcc问题)

1
gcc-9 -openmp xxxx.c

Simple,但是搞了我好久,mac上面开发环境什么都有就是权限上各种问题,还有各种私货。
0%