Python常用函数
1. 序列整数(range函数)
2. 断言assert
assert 表达式
如果表达式为Ture,则对程序没有影响,继续运行
如果表达式为False,则会抛出AssertionError,程序停止运行
例子:assert image_shape[1] != filter_shape[1]
这里的image_shape为(500,1,28,28)
filter_shape为(20,1,5,5)
可见image_shape[1] =1 == filter_shape[1] =1
所以,表达式assert image_shape[1] != filter_shape[1]为False,程序出错,抛出AssertionError
-------------------------------------------------------------------------------------------------------------------------------
博主为菜鸟一枚,发表博客的主要目的是为了记录科研中的点滴,方便自己以后查阅,如果有错误的地方,还请大家多提宝贵意见,如果有何侵犯到其他博主的内容,还请告知博主,将会及时处理!
另外,对于未标注转载的文章,均为博主自己整理,如需转载,请注明出处,谢谢!