TensorFlow源码框架 杂记
一.为什么我们需要使用线程池技术(ThreadPool)
线程:采用“即时创建,即时销毁”策略,即接受请求后,创建一个新的线程,执行任务,完毕后,线程退出;
线程池:应用软件启动后,立即创建一定数量的线程,放入空闲队列;
优缺点分析:使用线程处理多请求,低任务量问题时,不断创建、销毁线程,开销巨大;使用线程池能够减少创建销毁的开销;
二.C++11中使用unordered_map代替hash_map,另外增加了unique_ptr智能指针;(override GUARDED_BY等)
三.SWIG是一个非常优秀的开源工具,支持将C/C++代码与任何主流脚本语言相集成(包括Ruby,Perl、Tcl和Python)
四.阅读tensorflow源码
core/ops/ contains the "signatures" of the operations
core/kernels/ contains the "implementations" of the operations (including CPU and CUDA kernels)
core/framework/ contains the main abstract graph computation and other useful libraries
core/platform/ contains code that abstracts away the platform and other imported libraries (protobuf, etc)
TensorFlow relies heavily on the Eigen library for both CPU and GPU calculations. Though some GPU kernels are implemented directly with CUDA code.
bazel builds certain C++ code using gcc/clang, and certain CUDA code (files with extension .
cu.cc) with nvcc.
python/ops/ contain the core python interface
python/kernel_tests/ contain the unit tests and lots of example code
python/framework/ contains the python abstractions of graph, etc, a lot of which get serialized down to proto and/or get passed to swigged session calls.
python/platform/ is similar to the C++ platform, adding lightweight wrappers for python I/O, unit testing, etc.
contrib/*/ directories generally mimic the root tensorflow path (i.e., they have core/ops/, etc)
TensorFlow源码框架 杂记的更多相关文章
- Tensorflow源码解析1 -- 内核架构和源码结构
1 主流深度学习框架对比 当今的软件开发基本都是分层化和模块化的,应用层开发会基于框架层.比如开发Linux Driver会基于Linux kernel,开发Android app会基于Android ...
- tensorflow源码分析
前言: 一般来说,如果安装tensorflow主要目的是为了调试些小程序的话,只要下载相应的包,然后,直接使用pip install tensorflow即可. 但有时我们需要将Tensorflow的 ...
- Ubuntu TensorFlow 源码 Android Demo的编译运行
Ubuntu TensorFlow 源码 Android Demo的编译运行 一. 安装 Android 的SDK和NDK SDK 配置 A:下载 国内下载地址选最新的: SDK: https://d ...
- 编译TensorFlow源码
编译TensorFlow源码 参考: https://www.tensorflow.org/install/install_sources https://github.com/tensorflo ...
- TensorFlow源码安装
前言 TensorFlow如果能二进制包安装,我真的不想选择自己编译,但是情况不由人,好不容易找到一台服务器,CPU不支持AVX指令集,安装的release版本运行到import tensorflow ...
- Tensorflow[源码安装时bazel行为解析]
0. 引言 通过源码方式安装,并进行一定程度的解读,有助于理解tensorflow源码,本文主要基于tensorflow v1.8源码,并借鉴于如何阅读TensorFlow源码. 首先,自然是需要去b ...
- [图解tensorflow源码] 入门准备工作附常用的矩阵计算工具[转]
[图解tensorflow源码] 入门准备工作 附常用的矩阵计算工具[转] Link: https://www.cnblogs.com/yao62995/p/5773142.html tensorf ...
- [图解tensorflow源码] [原创] Tensorflow 图解分析 (Session, Graph, Kernels, Devices)
TF Prepare [图解tensorflow源码] 入门准备工作 [图解tensorflow源码] TF系统概述篇 Session篇 [图解tensorflow源码] Session::Run() ...
- 解决Tensorflow源码安装的之后TensorBoard 无法使用的问题
作者 cnblog 修雨轩陈 我是按照 Tensorflow 下 https://github.com/tensorflow/tensorflow/blob/master/tensorflow/g3 ...
随机推荐
- Linux服务器安全检测维护基础汇总/持续更新
登陆系统查询可以用户 w命令可以显示在线用户,passwd -l xxx可以锁定xxx用户无法登陆,如果此时可以用户在线,使用kill命令踢下线 查看可疑进程 ps -ef命令锁定pid,或者pido ...
- phpcms v9 完美更换整合Ueditor 1.3
phpcms这套系统相信大家不陌生,它做的很不错,但是也有好多地方不满足我们的需求,比如在线编辑器. 它自带的是CKEditor编辑器,功能较少,比如代码加亮功能就没有. 所以我来说一下怎么替换php ...
- python新手学习之文件读写之修改
文件除r.w.a方式打开外,还可以有多种组合方式如r+ w+ a+等多种方式 1.r+ 读写模式介绍,开始读是从一行开始读,写永远从最后开始写(类似于追加) # f = open("test ...
- Fedora 下面安装FTP服务
1. yum install vsftpd 2. systemctl disable vsftpd.service 3. systemctl stop vsftpd.service 4. system ...
- React Router 4.0 实现路由守卫
在使用 Vue 或者 Angular 的时候,框架提供了路由守卫功能,用来在进入某个路有前进行一些校验工作,如果校验失败,就跳转到 404 或者登陆页面,比如 Vue 中的 beforeEnter 函 ...
- Luogu P3120 [USACO15FEB]牛跳房子(金)Cow Hopscotch (Gold)
题目传送门 这是一道典型的记忆化搜索题. f[x][y]表示以x,y为右下角的方案数. code: #include <cstdio> #define mod 1000000007 usi ...
- 北京Uber优步司机奖励政策(1月15日)
滴快车单单2.5倍,注册地址:http://www.udache.com/ 如何注册Uber司机(全国版最新最详细注册流程)/月入2万/不用抢单:http://www.cnblogs.com/mfry ...
- linq中group by 的用法
如下代码: var dates=(from p in points group p by p.LevelId into g select new { g.Key,g });之后 你会拿到这个数组: 之 ...
- libevent学习三(Getting an event_base)
1.一个event_base持有了一系列的事件,并监控和决定哪些事件需要激活, 2.每一个event_base背后都有一个支持其工作的方法(诸如select,poll,epoll,kquene...) ...
- WEB中间件漏洞--IIS
1.iis安装 版本 一直下一步,选上iis安装 端口修改 网站目录 通过网站发布目录(发布目录任意),新建index.html页面,可以正常访问 2.iis6.0解析漏洞 (1)文件名解析 IIS在 ...