- 博客(59)
- 资源 (1)
- 收藏
- 关注
原创 mxnet基础到提高(48)-ones和ones_like
返回全1元素矩阵mxnet.ndarray.ones(shape, ctx=None, dtype=None, **kwargs)[source]Returns a new array filled with all ones, with the given shape and type.Parametersshape (int or tuple of int or list of int) – The shape of the empty array.ctx (Context, option
2021-01-31 22:00:06 235
原创 python3精要(64)-Python命名风格规范-google版
https://zh-google-styleguide.readthedocs.io/en/latest/google-python-styleguide/contents/见上面链接,个人认为是一个非常不错的Python编写规则。
2021-01-31 21:47:54 234
原创 编译与解释实践(1)-flex and bison 配置安装
sudo dnf instal flex bison下面先开始测试flex编辑test.l%option noyywrap //增加的语句%{int chars = 0;int words = 0;int lines = 0;%}%%[a-zA-Z]+ {words++; chars+= strlen(yytext);}\n {chars++; lines++;}. {chars++;}%%int main(int argc, char**
2021-01-29 23:35:26 255
原创 python3精要(62)-编译与解释实践(1)
欢迎来到PLY主页。 PLY是python的lex和yacc解析工具的实现。简而言之,PLY只是简单的lex / yacc实现。以下是其基本功能列表:它完全用Python实现。它使用LR解析,这是相当有效的,非常适合于较大的语法。PLY提供了大多数标准的lex / yacc功能,包括对空乘积,优先级规则,错误恢复的支持以及对歧义语法的支持。PLY易于使用,并提供非常广泛的错误检查。除了提供基本的lex / yacc功能之外,PLY不会尝试做更多或更少的事情。换句话说,它不是大型的解析框架,也不是
2021-01-29 21:44:49 181
原创 mxnet基础到提高(47)-RowSparseNDArray行切片的稀疏表示
类mxnet.ndarray.sparse.RowSparseNDArray(handle,writable = True)[bases:mxnet.ndarray.sparse.BaseSparseNDArray在给定索引处的一组NDArray行切片的稀疏表示。RowSparseNDArray使用两个单独的数组表示多维NDArray:数据和索引。 尺寸数必须至少为2。数据:形状为[D0,D1,…,Dn]的任何dtype的NDArray。索引:形状为[D0]的一维int64 NDArray,其值按
2021-01-28 21:55:33 159 1
原创 linux内核杂记(18)-内核链表结构(2)
1、内核需要记录链表头,这样,在不知道prev和next,也不知道结构中的list_head类型的成员 地址的情况下,可以找到链表和链表结构嵌入的数据。比如以下形式:static LIST_HEAD(mydata_list)2、增加一个节点static inline void __list_add(struct list_head *new, struct list_head *prev, struct list_head *next){ if (!__list
2021-01-28 12:06:52 76
原创 mxnet基础到提高(46)-ndarray.zeros,CSRNDArray稀疏矩阵
mxnet.ndarray.zeros(shape, ctx=None, dtype=None, stype=None, **kwargs)[source]返回一个新的array数组,指定shape和type(形状和类型),用0填充参数shape(int 或 int tuple元组):空数组的形状ctx (Context, 可选项) – 一个可选设备上下文dtype (字符串表示的类型名称 or numpy.dtype, 可选) – 可选类型类型,默认为float32stype (str
2021-01-26 22:33:33 371
原创 mxnet基础到提高(45)-ndarray.arange,ndarray.shape,ndarray.size
from mxnet import ndx=nd.arange(23)y=nd.array([1,2,3,4,5])z=nd.array([[1,2],[3,4]])print(z)print(z.shape)print(z.size)print(y)print(y.shape)print(y.size)print(x)print(x.shape)print(x.size)[[1. 2.] [3. 4.]]<NDArray 2x2 @cpu(0)>(2, 2)
2021-01-26 22:17:11 108 1
原创 坚果云feodra(linux)启动失败
坚果云可运行在LINUX、MAC、WIN下,属于国内网盘,linux下还有一个选择就是WPS 的云盘。安装顺序应是先安装rpm,反复尝试失败后,再从源码安装。1、注意观察python是否可导入gi因为我的电脑上安装了anaconda,上面运行的python3.8fedora33的Python版本是3.9,会存在版本冲突。那么要确定好坚果云用的哪个版本,包括dropbox也一样。不管哪个版本,最容易造成启动异常的是import gi 失败。此时需要pip安装> pip insta...
2021-01-25 21:16:28 998
原创 python3精要(35)-模块(1)-import
from和import 导入模块import 读取整个模块,而from只导入模块中的某些变量和函数# -*- coding: utf-8 -*-"""Spyder EditorThis is a temporary script file."""import testmoduleprint(testmodule.x)# -*- coding: utf-8 -*-"""Created on Sat Jan 23 13:54:16 2021@author: Administrato
2021-01-23 14:29:47 147
原创 mxnet基础到提高(44)-ndarray.arange创建行向量
mxnet.ndarray.arange(start, stop=None, step=1.0, repeat=1, infer_range=None, ctx=None, dtype=<class 'numpy.float32'>)参数start (number, optional) – 起点,可选项,默认为0stop (number) – 终点step (number, optional) – 中间间隔跳步,默认为1repeat (int, optional) – 每个元素
2021-01-22 10:34:01 171
原创 c++17(22)-reinterpret_cast和new动态空间内存申请
reinterpret_cast表示将变量转换为其它类型,但需要按原来的用途使用它时,需要转换为原来的类型,不转换是无法使用的。#include <iostream>using namespace std;struct Info{ int x[3];};int main(int argc, char **argv){ Info myInfo; int *a=reinterpret_cast<int *>(&myInfo); *a=1;
2021-01-21 20:04:38 283 1
原创 c++17(21)-volatile和const、const_cast
#include <iostream>using namespace std;int main(int argc, char **argv){ volatile int x1=11; x1=15; const int x2=86; cout<<x1<<endl; cout<<x2<<endl; return 0;}volatile表示不知道何时会改变,随时有可能有改变,并且随时可以改变。因此编译器对访问该变量的代码不能进行
2021-01-21 15:47:23 324
原创 mxnet基础到提高(43)-编译安装
因为pip方式安装,不能安装c++接口,此外,此方式安装的包,是使用默认参数编译的,很多运行环境要求使用指定参数编译,比如,不支持GPU,不支持SSE,还有嵌入式环境或上网本等低档设备以及端设备运行。所以,需要编译安装https://mxnet.cdn.apache.org/versions/master/api/cpp.htmlgit clone --recursive https://github.com/apache/incubator-mxnet mxnetsudo yum install e
2021-01-19 23:36:55 157
原创 python3精要(37)-wxPython(3)-安装
1、pippip install -U wxpython2、源码编译安装https://pypi.org/project/wxPython/#fileswget https://files.pythonhosted.org/packages/b0/4d/80d65c37ee60a479d338d27a2895fb15bbba27a3e6bb5b6d72bb28246e99/wxPython-4.1.1.tar.gztar zxvf wxPython-4.1.1.tar.gzcd wxPyt
2021-01-19 23:17:29 223
原创 wxWidgets随笔(10)-fedora环境配置
1、wxwidgets安装sudo yum install wxGTK-develsudo dnf install wxGTK wxGTK-devel wxGTK-gl wxBase wxsvg wxsvg-devel wxGlade wxGTK3 wxGTK3-devel wxGTK3-gl wxBase3 wxGTK-media wxGTK3-media wxGTK3-webview wxGTK3-xmldocs mathgl-wx wxMaxima wxsqlite3 wxpdfdoc wxPyt
2021-01-16 13:36:50 332
原创 opencv精要(4)-fedora下的opencv安装及测试,codelite配置
安装sudo yum install opencv opencv-devel opencv-doc启动 Screenshot (截图)编写2个测试代码im testopencv1.cpp#include <iostream>#include <opencv2/opencv.hpp>#include <opencv2/highgui/highgui_c.h> using namespace std;using namespace cv; int m
2021-01-14 21:28:21 241
原创 visual basic2019.net-数组,dim.redim
Imports SystemModule Program Sub Main(args As String()) Dim numbers(,) As Integer = {{1, 2}, {3, 4}, {5, 6}} For index0 = 0 To numbers.GetUpperBound(0) For index1 = 0 To numbers.GetUpperBound(1) Console.Wr
2021-01-13 17:05:13 233
原创 c++17(20)-双向循环链表(不依赖具体数据)
双向循环链表(不依赖具体数据),借鉴LINUX内核的链表结构#include <iostream>using namespace std;struct stdlist{ stdlist *prev; stdlist *next;} ;struct student{ int id; string *name; stdlist list;} ;int main(int argc, char **argv){ stdlist *li
2021-01-13 09:05:29 165
原创 opencv精要(3)-win下codelite的opencv配置
1、参照安装或编译好opencvhttps://aipro.blog.csdn.net/article/details/1125384532、配置codeliteI:\opencv\opencv\build\includeI:\opencv\opencv\build\include\opencv2\highgui
2021-01-12 17:58:28 225
原创 opencv精要(2)-opencv在windows下安装
要使用OpenCV库,您有两个选择:通过使用预构建库进行安装或通过从源文件构建自己的库进行安装。尽管第一个更容易完成,但是只有当您使用最新的Microsoft Visual Studio IDE进行编码并且不利用我们集成到库中的最先进的技术时,它才有效。… _Windows_Install_Prebuild:使用预建库进行安装启动选择的Web浏览器,然后转到Sourceforge上的页面。选择您要使用的内部版本并下载。确保您具有管理员权限。解压缩自解压存档。您可以在选定的路径下检查安装,如下所示。
2021-01-12 17:22:52 213
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人