上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 18 下一页
摘要: 一段时间不碰又忘记了,必须写下博客以记之。。 简单来说,none的作用是增加一个维度(和 np.newaxis 等价),... 三个点的意思是省略所有冒号,即代表原来的所有数据。 比如原来的数组维度是 3, 224 ,224, 使用 data [None, ... ] 或者 data [None, 阅读全文
posted @ 2021-06-10 16:48 略略略—— 阅读(1457) 评论(0) 推荐(1) 编辑
摘要: nums[] 3 4 7 2 -3 1 4 2 preSum[] 0 3 7 14 16 13 14 18 20 差值(k=7) -4 0 7 9 6 7 11 13 计数 1 1 1 1 说明: 原始暴力解的判断语句: for (int i = 1; i <= n; i++) for (int j 阅读全文
posted @ 2021-06-04 15:09 略略略—— 阅读(34) 评论(0) 推荐(0) 编辑
摘要: 先来看一下官方文档的api简介: TensorRT provides a C++ implementation on all supported platforms, and a Python implementation on Linux. Python is not currently supp 阅读全文
posted @ 2021-06-03 12:38 略略略—— 阅读(4980) 评论(0) 推荐(0) 编辑
摘要: 首先单位是字节,比如 builder.max_workspace_size = 1<< 30 就是 2^30 bytes 即 1 GB。 它的作用是给出模型中任一层能使用的内存上限。运行时,每一层需要多少内存系统分配多少,并不是每次都分 1 GB,但不会超过 1 GB。 One particular 阅读全文
posted @ 2021-06-02 15:43 略略略—— 阅读(3107) 评论(0) 推荐(0) 编辑
摘要: 最近学习CUDA编程,见以下代码:https://github.com/wang-xinyu/tensorrtx/blob/master/lenet/lenet.cpp 其中经常出现一个检查内存分配是否政策的宏函数CHECK: 1 #define CHECK(status) \ 2 do\ 3 {\ 阅读全文
posted @ 2021-06-01 15:57 略略略—— 阅读(688) 评论(0) 推荐(0) 编辑
摘要: Paddle* p1, p2; 变量声明。 p1 = new Paddle(1, h/2 - 3); p2 = new Paddle(w-2, h/2 - 3); 创建变量。 然而vscode却提示错误: no operator "=" matches these operands -- opera 阅读全文
posted @ 2021-05-31 16:49 略略略—— 阅读(363) 评论(0) 推荐(0) 编辑
摘要: 3种友元:1、友元函数;2、友元类;3、友元成员函数。 需要友元的一个常见情形:为类的双目运算符重载。 A = B * 2.75; 将被转换为以下的成员函数调用: A = B.operator* ( 2.75); 但如果: A = 2.75 * B; 则无法匹配到合适的成员函数,因为左侧的操作数应该 阅读全文
posted @ 2021-05-27 16:38 略略略—— 阅读(794) 评论(0) 推荐(0) 编辑
摘要: 对于内置数组以及包含方法 begin() 和 end() 的类(如std::string)和STL容器,基于范围的for循环可简化为它们编写循环的工作。······一种更容易、更安全的方式是,使用auto来声明x,这样编译器将根据prices声明中的信息来推断x的类型: double prices[ 阅读全文
posted @ 2021-05-27 13:52 略略略—— 阅读(405) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> using namespace std; //相同的内存地址 union myun { struct { int x; int y; int z; }u; int k; }a; int main() { a.u.x =4; a.u.y =5; a.u.z =6; 阅读全文
posted @ 2021-05-25 16:00 略略略—— 阅读(266) 评论(0) 推荐(0) 编辑
摘要: sudo nvpmodel -q 查看当前功率状态。 sudo nvpmodel -m1 sudo nvpmodel -m0 性能模式切换。 在jetson nano中,如果开启5w的低功率模式,通过jtop命令可以看到2号3号CPU被关闭,只有0号1号CPU运转。具体可以在 /etc/nvpmod 阅读全文
posted @ 2021-05-20 15:58 略略略—— 阅读(4599) 评论(0) 推荐(1) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 18 下一页