Skip to content

Instantly share code, notes, and snippets.

@hewumars
Last active January 22, 2021 02:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hewumars/6889eaf6e8b279b930eddf1e606f8ace to your computer and use it in GitHub Desktop.
Save hewumars/6889eaf6e8b279b930eddf1e606f8ace to your computer and use it in GitHub Desktop.
torch.mm()
torch.bmm() batch-matrix-matrix两个3-dims矩阵相乘
torch.matmul()
weights.reshape()
weights.resize_()
weights.view()
weights.from_numpy(numpy array)
tensor.numpy()
torch.detach()返回一个新的从当前图中分离出来的Variable,该Variable永远不需要梯度
pytorch均值方差(bgr*255-mean)/std => svn工程 bgr*vStd - vMean 用numpy转换vMean = np.array([mean_b,mean_g,mean_r])/np.array([std_b,std_g,std_r]) vStd = 1/(255*np.array([std_b,std_g,std_r]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment