![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Python
LittleOne008
这个作者很懒,什么都没留下…
展开
-
RuntimeError: cannot cache function ‘__shear_dense‘: no locator available for file
RuntimeError: cannot cache function '__shear_dense'原创 2023-01-31 11:14:54 · 566 阅读 · 0 评论 -
Python实现平方根倒数速算法
0x5f3759dfclass Solution(): def mySqrt(self,num): t = num t = 0x5f3759df - (t >> 1) while not (t * t <= num and (t+1) * (t + 1) > num): t = (num / ...原创 2019-10-18 14:49:10 · 1631 阅读 · 4 评论 -
python version 3.6 does not support a 'ur' prefix
http://bugs.python.org/issue15096Drop support for the “ur” string prefixWhen PEP 414 restored support for explicit Unicode literals in Python 3, the “ur” string prefix was deemed to be a synonym for...原创 2019-09-24 15:17:07 · 2512 阅读 · 0 评论 -
RuntimeError: exp_vml_cpu not implemented for 'Long'
运行http://nlp.seas.harvard.edu/2018/04/03/attention.htm报错position = torch.arange(0, max_len).unsqueeze(1)div_term = torch.exp(torch.arange(0, d_model, 2) * -(math.log(10000.0) / d_model))修改为:...原创 2019-09-03 15:10:20 · 6801 阅读 · 5 评论 -
NameError: name 'unicode' is not defined
python2中的unicode()函数在python3中会报错:将unicode()转换为 str()为://python2:unicode(row[col_name],'utf-8')//python3:str(row[col_name])原创 2019-08-30 15:05:44 · 8248 阅读 · 0 评论 -
Python super() 函数
描述super() 函数是用于调用父类(超类)的一个方法。super 是用来解决多重继承问题的,直接用类名调用父类方法在使用单继承的时候没问题,但是如果使用多继承,会涉及到查找顺序(MRO)、重复调用等种种问题。MRO 就是类的方法解析顺序表, 其实也就是继承父类方法时的顺序表。语法以下是 super() 方法的语法:super(type[, object-or-type])参数...原创 2019-08-29 15:09:57 · 94 阅读 · 0 评论 -
Python中self
Python中self用法详解:https://blog.csdn.net/CLHugh/article/details/75000104原创 2019-08-22 13:29:23 · 226 阅读 · 0 评论