Showing preview only (2,358K chars total). Download the full file or copy to clipboard to get everything.
Repository: jikexueyuanwiki/tensorflow-zh
Branch: master
Commit: 28dd80bc65d6
Files: 181
Total size: 2.2 MB
Directory structure:
gitextract_iq8tfs9_/
├── .gitignore
├── README.md
├── README副本.md
├── SOURCE/
│ ├── api_docs/
│ │ ├── cc/
│ │ │ ├── ClassEnv.md
│ │ │ ├── ClassEnvWrapper.md
│ │ │ ├── ClassRandomAccessFile.md
│ │ │ ├── ClassSession.md
│ │ │ ├── ClassStatus.md
│ │ │ ├── ClassTensor.md
│ │ │ ├── ClassTensorBuffer.md
│ │ │ ├── ClassTensorShape.md
│ │ │ ├── ClassTensorShapeIter.md
│ │ │ ├── ClassTensorShapeUtils.md
│ │ │ ├── ClassThread.md
│ │ │ ├── ClassWritableFile.md
│ │ │ ├── StructSessionOptions.md
│ │ │ ├── StructState.md
│ │ │ ├── StructTensorShapeDim.md
│ │ │ ├── StructThreadOptions.md
│ │ │ └── index.md
│ │ ├── index.md
│ │ └── python/
│ │ ├── array_ops.md
│ │ ├── client.md
│ │ ├── constant_op.md
│ │ ├── control_flow_ops.md
│ │ ├── framework.md
│ │ ├── image.md
│ │ ├── index.md
│ │ ├── io_ops.md
│ │ ├── math_ops.md
│ │ ├── nn.md
│ │ ├── python_io.md
│ │ ├── sparse_ops.md
│ │ ├── state_ops.md
│ │ └── train.md
│ ├── extras/
│ │ └── README.txt
│ ├── faq.md
│ ├── get_started/
│ │ ├── basic_usage.md
│ │ ├── introduction.md
│ │ └── os_setup.md
│ ├── how_tos/
│ │ ├── __init__.py
│ │ ├── adding_an_op/
│ │ │ ├── __init__.py
│ │ │ ├── attr_examples.cc
│ │ │ ├── fact_test.py
│ │ │ ├── index.md
│ │ │ ├── zero_out_1_test.py
│ │ │ ├── zero_out_2_test.py
│ │ │ ├── zero_out_3_test.py
│ │ │ ├── zero_out_grad_2.py
│ │ │ ├── zero_out_op_kernel_1.cc
│ │ │ ├── zero_out_op_kernel_2.cc
│ │ │ └── zero_out_op_kernel_3.cc
│ │ ├── adding_an_op.md
│ │ ├── graph_viz/
│ │ │ └── index.md
│ │ ├── graph_viz.md
│ │ ├── new_data_formats/
│ │ │ ├── Custom Data Readers.md
│ │ │ └── index.md
│ │ ├── new_data_formats.md
│ │ ├── overview.md
│ │ ├── reading_data/
│ │ │ ├── __init__.py
│ │ │ ├── convert_to_records.py
│ │ │ ├── fully_connected_preloaded.py
│ │ │ ├── fully_connected_preloaded_var.py
│ │ │ ├── fully_connected_reader.py
│ │ │ └── index.md
│ │ ├── reading_data.md
│ │ ├── summaries_and_tensorboard/
│ │ │ └── index.md
│ │ ├── summaries_and_tensorboard.md
│ │ ├── threading_and_queues/
│ │ │ └── index.md
│ │ ├── threading_and_queues.md
│ │ ├── using_gpu/
│ │ │ └── index.md
│ │ ├── using_gpu.md
│ │ ├── variable_scope/
│ │ │ └── index.md
│ │ ├── variable_scope.md
│ │ ├── variables/
│ │ │ └── index.md
│ │ └── variables.md
│ ├── images/
│ │ └── getting_started.dot
│ ├── index.md
│ ├── personal.md
│ ├── resource.md
│ ├── resources/
│ │ ├── bib.md
│ │ ├── dims_types.md
│ │ ├── faq.md
│ │ ├── glossary.md
│ │ ├── overview.md
│ │ └── uses.md
│ └── tutorials/
│ ├── BUILD
│ ├── __init__.py
│ ├── deep_cnn/
│ │ ├── cifar_tensorboard.html
│ │ └── index.md
│ ├── deep_cnn.md
│ ├── mandelbrot/
│ │ └── index.md
│ ├── mandelbrot.md
│ ├── mnist/
│ │ ├── __init__.py
│ │ ├── beginners/
│ │ │ └── index.md
│ │ ├── download/
│ │ │ └── index.md
│ │ ├── fully_connected_feed.py
│ │ ├── input_data.py
│ │ ├── mnist.py
│ │ ├── mnist_softmax.py
│ │ ├── pros/
│ │ │ └── index.md
│ │ └── tf/
│ │ └── index.md
│ ├── mnist_beginners.md
│ ├── mnist_download.md
│ ├── mnist_pros.md
│ ├── mnist_tf.md
│ ├── overview.md
│ ├── pdes/
│ │ └── index.md
│ ├── pdes.md
│ ├── recurrent/
│ │ └── index.md
│ ├── recurrent.md
│ ├── seq2seq/
│ │ └── index.md
│ ├── seq2seq.md
│ ├── word2vec/
│ │ ├── __init__.py
│ │ ├── index.md
│ │ └── word2vec_basic.py
│ └── word2vec.md
├── TOC.md
├── config.json
├── learn-github.md
├── markdown.md
└── tex_pdf/
├── api/
│ ├── c4s00.tex
│ ├── cc/
│ │ ├── ClassEnv.md
│ │ ├── ClassEnvWrapper.md
│ │ ├── ClassRandomAccessFile.md
│ │ ├── ClassSession.md
│ │ ├── ClassStatus.md
│ │ ├── ClassTensor.md
│ │ ├── ClassTensorBuffer.md
│ │ ├── ClassTensorShape.md
│ │ ├── ClassTensorShapeIter.md
│ │ ├── ClassTensorShapeUtils.md
│ │ ├── ClassThread.md
│ │ ├── ClassWritableFile.md
│ │ ├── StructSessionOptions.md
│ │ ├── StructState.md
│ │ ├── StructTensorShapeDim.md
│ │ ├── StructThreadOptions.md
│ │ └── index.md
│ └── python/
│ ├── c4s01_framework.tex
│ ├── c4s02_constant_op.tex
│ ├── c4s03_state_ops.tex
│ ├── c4s04_array_ops.tex
│ ├── c4s05_math_ops.tex
│ ├── c4s06_control_flow_ops.tex
│ ├── c4s07_image.tex
│ ├── c4s08_sparse_ops.tex
│ ├── c4s09_io_ops.tex
│ ├── c4s10_python_io.tex
│ ├── c4s11_nn.tex
│ ├── c4s12_client.tex
│ ├── c4s13_train.tex
│ └── index.tex
├── get_started/
│ ├── c1s01_introduction.tex
│ ├── c1s02_os_setup.tex
│ └── c1s03_basic_usage.tex
├── how_tos/
│ ├── c3s00_overview.tex
│ ├── c3s01_variables.tex
│ ├── c3s02_variable_scope.tex
│ ├── c3s03_viz_learning.tex
│ ├── c3s04_graph_viz.tex
│ ├── c3s05_reading_data.tex
│ ├── c3s06_threading_and_queues.tex
│ ├── c3s07_adding_an_op.tex
│ ├── c3s08_new_data_formats.tex
│ └── c3s09_using_gpu.tex
├── tensorflow_manual_cn.idx
├── tensorflow_manual_cn.ilg
├── tensorflow_manual_cn.ind
├── tensorflow_manual_cn.tex
└── tutorials/
├── c2s00_overview.tex
├── c2s01_minist_beginners.tex
├── c2s02_minist_pros.tex
├── c2s03_.tex
├── c2s04_.tex
├── c2s05_word2vec.tex
├── c2s06_recurrent.tex
├── c2s07_seq2seq.tex
├── c2s08_2_9_mandelbrot.tex
├── c2s09_pdes.tex
└── c2s10_mnist_download.tex
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
*.aux
*.fdb_latexmk
*.log
*.out
*.synctex.gz
*.toc
*.fls
*.sublime-project
*.sublime-workspace
*.DS_Store
*.idea
================================================
FILE: README.md
================================================
# TensorFlow 官方文档中文版

### 你正在阅读的项目可能会比 Android 系统更加深远地影响着世界!
## 缘起
2015年11月9日,Google发布人工智能系统TensorFlow并宣布开源,同日,极客学院组织在线TensorFlow中文文档翻译。
机器学习作为人工智能的一种类型,可以让软件根据大量的数据来对未来的情况进行阐述或预判。如今,领先的科技巨头无不在机器学习下予以极大投入。Facebook、苹果、微软,甚至国内的百度。Google 自然也在其中。「TensorFlow」是 Google 多年以来内部的机器学习系统。如今,Google 正在将此系统成为开源系统,并将此系统的参数公布给业界工程师、学者和拥有大量编程能力的技术人员,这意味着什么呢?
打个不太恰当的比喻,如今 Google 对待 TensorFlow 系统,有点类似于该公司对待旗下移动操作系统 Android。如果更多的数据科学家开始使用 Google 的系统来从事机器学习方面的研究,那么这将有利于 Google 对日益发展的机器学习行业拥有更多的主导权。
为了让国内的技术人员在最短的时间内迅速掌握这一世界领先的 AI 系统,极客学院 Wiki 团队发起对 TensorFlow 官方文档的中文协同翻译,一周之内,全部翻译认领完成,一个月后,全部30章节翻译校对完成,上线极客学院Wiki平台并提供下载。
Google TensorFlow项目负责人Jeff Dean为该中文翻译项目回信称:"*看到能够将TensorFlow翻译成中文我非常激动,我们将TensorFlow开源的主要原因之一是为了让全世界的人们能够从机器学习与人工智能中获益,类似这样的协作翻译能够让更多的人更容易地接触到TensorFlow项目,很期待接下来该项目在全球范围内的应用!*"
Jeff回信原文:

再次衷心感谢每一位为该翻译项目做出贡献的同学,我们会持续关注TensorFlow、AI领域以及其它最新技术的发展、持续维护该协作翻译、持续提供更多更优质的内容,为广大IT学习者们服务!
## 内容来源
英文官方网站:
<http://tensorflow.org/>
官方GitHub仓库:
<https://github.com/tensorflow/tensorflow>
中文版 GitHub 仓库:
<https://github.com/jikexueyuanwiki/tensorflow-zh>
## 参与者(按认领章节排序)
### 翻译
- [@PFZheng](https://github.com/PFZheng)
- [@Tony Jin](https://github.com/linbojin)
- [@chenweican](https://github.com/chenweican)
- [@bingjin](https://github.com/bingjin)
- [@oskycar](https://github.com/oskycar)
- [@btpeter](https://github.com/btpeter)
- [@Warln](https://github.com/Warln)
- [@ericxk](https://github.com/ericxk)
- [@wangaicc](https://github.com/wangaicc)
- [@Terence Cooper](https://github.com/TerenceCooper)
- [@zhyhooo](https://github.com/zhyhooo)
- [@thylaco1eo](https://github.com/thylaco1eo)
- [@volvet](https://github.com/volvet)
- [@zhangkom](https://github.com/zhangkom)
- [@derekshang](https://github.com/derekshang)
- [@lianghyv](https://github.com/lianghyv)
- [@nb312](https://github.com/nb312)
- [@Jim-Zenn](https://github.com/Jim-Zenn)
- [@andyiac](https://github.com/andyiac)
- [@Terence Cooper](https://github.com/TerenceCooper)
- [@leege100](https://github.com/leege100)
### 校对
- [@yangtze](https://github.com/sstruct)
- [@ericxk](https://github.com/ericxk)
- [@HongyangWang](https://github.com/WangHong-yang)
- [@LichAmnesia](https://github.com/LichAmnesia)
- [@zhyhooo](https://github.com/zhyhooo)
- [@waiwaizheng](https://github.com/waiwaizheng)
- [@HongyangWang](https://github.com/WangHong-yang)
- [@tensorfly](https://github.com/tensorfly)
- [@lonlonago](https://github.com/lonlonago)
- [@jishaoming](https://github.com/jishaoming)
- [@lucky521](https://github.com/lucky521)
- [@allensummer](http://github.com/allensummer)
- [@volvet](https://github.com/volvet)
- [@ZHNathanielLee](https://github.com/ZHNathanielLee)
- [@pengfoo](https://github.com/PengFoo)
- [@qiaohaijun](https://github.com/qiaohaijun)
- [@Seika](https://github.com/SeikaScarlet)
## 进度记录
- 2015-11-10, 谷歌发布全新人工智能系统TensorFlow并宣布开源, 极客学院Wiki启动协同翻译,创建 GitHub 仓库,制定协同规范
- 2015-11-18, 所有章节认领完毕,翻译完成18章,校对认领7章,Star数361,fork数100,协同翻译QQ群及技术交流群的TF爱好者将近300人,GitHub搜索TensorFlow排名第二
- 2015-12-10, Star数超过500
- 2015-12-15, 项目正式上线
## 花絮
在组织翻译的过程中,有些事情令人印象深刻,记录下来,希望以后来学习文档的同学能够明了到手中这份文档的由来:
- 参加翻译的有学生,也有老师;有专门研究AI/ML的,也有对此感兴趣的;有国内的,也有远在纽约的;有工程技术人员也有博士、专家
- 其中一位,[恩泽](http://www.longmotto.com)同学,为了翻译一篇文档,在前一天没有睡觉的情况下坚持翻完,20个小时没有合眼
- 还有一位老师,刚从讲台上讲完课,就立即给我们的翻译提修改意见
- 很多同学自发的将搭建环境中遇到的问题总结到FAQ里帮助他人
- 为了一个翻译细节,经常是来回几次,和其他人讨论完善
## 持续改进
这样的一个高技术领域的文档,我们在翻译的过程中,难免会有不完善的地方,希望请大家一起帮助我们持续改进文档的翻译质量,帮助更多的人,方法:
- 在GitHub上提Issue或Pull Request,地址为: [https://github.com/jikexueyuanwiki/tensorflow-zh](https://github.com/jikexueyuanwiki/tensorflow-zh)
- 加入TensorFlow技术交流群,与TensorFlower们一起研究交流技术干货--TensorFlow技术交流群:782484288
- 对翻译感兴趣?加入协同翻译群:248320884,与翻译大神一道研究TensorFlow的本地化
- 给我们写邮件: wiki@jikexueyuan.com
## 感谢支持
- [极客学院 Wiki](http://wiki.jikexueyuan.com) 提供图文教程托管服务
## 离线版本
目前,离线版本(PDF、ePub)可正常下载、使用
## Tex-PDF 修订版
[Tex-PDF 修订版](tex_pdf) 目前正在编订中,欢迎加入进来一起修订。您可以在此查看[预览版](tex_pdf/tensorflow_manual_cn.pdf)目前最新状态。
================================================
FILE: README副本.md
================================================
# TensorFlow 官方文档中文版

### 你正在翻译的项目可能会比 Android 系统更加深远地影响着世界!
## 缘起
2015年11月9日,Google 官方在其博客上称,Google Research 宣布推出第二代机器学习系统 TensorFlow,针对先前的 DistBelief 的短板有了各方面的加强,更重要的是,它是开源的,任何人都可以用。
机器学习作为人工智能的一种类型,可以让软件根据大量的数据来对未来的情况进行阐述或预判。如今,领先的科技巨头无不在机器学习下予以极大投入。Facebook、苹果、微软,甚至国内的百度。Google 自然也在其中。「TensorFlow」是 Google 多年以来内部的机器学习系统。如今,Google 正在将此系统成为开源系统,并将此系统的参数公布给业界工程师、学者和拥有大量编程能力的技术人员,这意味着什么呢?
打个不太恰当的比喻,如今 Google 对待 TensorFlow 系统,有点类似于该公司对待旗下移动操作系统 Android。如果更多的数据科学家开始使用 Google 的系统来从事机器学习方面的研究,那么这将有利于 Google 对日益发展的机器学习行业拥有更多的主导权。
为了让国内的技术人员在最短的时间内迅速掌握这一世界领先的 AI 系统,极客学院 Wiki 团队发起对 TensorFlow 官方文档的中文协同翻译。
欢迎各路人工智能及机器学习领域的专家和爱好者参与这一翻译项目,我们会为每位翻译和校对人员署名。
## 一起来参与
如果想做出贡献(翻译或者校对)的话,请加QQ群:248320884,谢谢!
PS: 想探讨TensorFlow技术的可以加"TensorFlow技术交流群":495115006
## 内容来源
英文官方网站:
<http://tensorflow.org/>
官方GitHub仓库:
<https://github.com/tensorflow/tensorflow>
中文版 GitHub 仓库:
<https://github.com/jikexueyuanwiki/tensorflow-zh>
## 关于TensorFlow的一些报道
[野心:像开放安卓一样,这一次,谷歌决定开放它的机器学习系统——TensorFlow](http://www.huxiu.com/article/130763/1.html?f=wangzhan)
[最强大机器学习平台开源 谷歌准备主宰人工智能?](http://m.wallstreetcn.com/node/226012)
## 参与步骤
* fork主仓库(<https://github.com/jikexueyuanwiki/tensorflow-zh>)
* 按照章节认领翻译(每次申请一个章节)或者校对(可申请多个章节)在下面这个`README.md`里找还没有被人申请的章节,写上(@你的github号),给主仓库的`master`分支提pull request;
* 提的 pull request 被确认,合并到主仓库后,代表你申请的章节*认领*完成,开始翻译或校对;
* 翻译或校对的文件为README.md或者TOC.md中对应的md文件,请不要翻译/校对单独文件夹中的index.md
* 翻译过程请参照 *翻译协作规范* (见下一节),完成翻译后提交 pull request 给主仓库的`master`分支;
* 完成校对后同样提交 pull request 给主仓库的`master`分支;
* 全部翻译/校对完成后,我们会生成PDF/ePub文档,放在极客学院Wiki平台发布,并为所有参与者署名!
## 翻译协作规范
为了让大家协作顺畅,需要每一个人遵循如下协作规范~
- 如果对Markdown和GitHub不了解,请先阅读[如何使用Markdown](markdown.md)以及[如何使用GitHub](learn-github.md)
- 使用Markdown进行翻译,文件名必须使用英文
- 翻译后的文档请放到SOURCE文件夹下的对应章节中,然后pull request即可
- 如遇到文中的图片,请统一放在SOURCE/images目录下
- 原文中的HTML标签及代码请不要修改、翻译
- 有其他任何问题都欢迎发issue,我们看到了会尽快回复
- 翻译人员需将对应的原文地址和翻译人姓名添加到译文末尾,审校人员需要将自己的名字添加到译文末尾,具体格式请参见样例:
> 原文:[Color Palettes](http://www.google.com/design/spec/resources/color-palettes.html) 翻译:[iceskysl](https://github.com/iceskysl) 校对:[PoppinLp](https://github.com/poppinlp)
## 校对规范
- 认领校对时请提供机器学习 or AI方面的专业背景说明,保证校对质量
- 文章通顺,适合人类阅读与理解,别让人以为是机翻
- 确保图片都能正常显示,且其相对地址都是SOURCE/images,图片存放正确
- 专有名词符合术语表中的翻译要求,拿不准的新词汇可以使用中文翻译后加括号内英文的形式
- 校对人员需有一定专业背景,保证译文无专业知识方面错误
- 请查看翻译人员是否将原文链接和翻译链接放到译文最下方,审校人员需要将自己的名字添加到译文末尾,具体格式请参见样例:
> 原文:[Color Palettes](http://www.google.com/design/spec/resources/color-palettes.html) 翻译:[iceskysl](https://github.com/iceskysl) 校对:[PoppinLp](https://github.com/poppinlp)
- 有任何问题请提Issues或到协同翻译群讨论,校对后提PR等待Merge,管理员通过后会在目录后面打√标识完成
## 参与者(按认领章节排序)
### 翻译 & 校对
- 起步
- [简介](get_started/introduction.md) 翻译:([@PFZheng](https://github.com/PFZheng))√ 校对:([@yangtze](https://github.com/sstruct))√
- [下载及安装](get_started/os_setup.md) 翻译:([@PFZheng](https://github.com/PFZheng))√ 校对: ([@yangtze](https://github.com/sstruct))√
- [基本用法](get_started/basic_usage.md) 翻译:([@PFZheng](https://github.com/PFZheng))√ 校对:([@yangtze](https://github.com/sstruct))√
- 教程
- [综述](tutorials/overview.md) 翻译:([@PFZheng](https://github.com/PFZheng))√ 校对: ([@ericxk](https://github.com/ericxk)) √
- [MNIST机器学习入门](tutorials/mnist_beginners.md) 翻译:([@Tony Jin](https://github.com/linbojin))√ 校对: ([@ericxk](https://github.com/ericxk))
- [深入MNIST](tutorials/mnist_pros.md) 翻译:([@chenweican](https://github.com/chenweican))√ 校对: ([@HongyangWang](https://github.com/WangHong-yang)) √
- [TensorFlow运作方式入门](tutorials/mnist_tf.md) 翻译:([@bingjin](https://github.com/bingjin))√ 校对: ([@LichAmnesia](https://github.com/LichAmnesia)) √
- [卷积神经网络](tutorials/deep_cnn.md) 翻译: ([@oskycar](https://github.com/oskycar))√ 校对: ([@zhyhooo](https://github.com/zhyhooo))
- [Vector Representations of Words](tutorials/word2vec.md)翻译: ([@btpeter](https://github.com/btpeter)) √ 校对: ([@waiwaizheng](https://github.com/waiwaizheng))
- [递归神经网络](tutorials/recurrent.md) 翻译:([@Warln](https://github.com/Warln))√ 校对: ([@HongyangWang](https://github.com/WangHong-yang))
- [曼德布洛特(Mandelbrot)集合](tutorials/mandelbrot.md) 翻译:([@ericxk](https://github.com/ericxk))√ 校对: ([@tensorfly](https://github.com/tensorfly))√
- [偏微分方程](tutorials/pdes.md) 翻译:([@wangaicc](https://github.com/wangaicc))√ 校对: ([@tensorfly](https://github.com/tensorfly))√
- [MNIST数据下载](tutorials/mnist_download.md) 翻译: ([@btpeter](https://github.com/btpeter)) √ 校对: ([@waiwaizheng](https://github.com/waiwaizheng))
- 运作方式
- [总览](how_tos/overview.md) 翻译: ([@Terence Cooper](https://github.com/TerenceCooper))√ 校对:
([@lonlonago](https://github.com/lonlonago)) √
- [变量:创建、初始化、保存和加载](how_tos/variables.md) 翻译: ([@zhyhooo](https://github.com/zhyhooo))√ 校对: ([@jishaoming](https://github.com/jishaoming))
- [TensorBoard:可视化学习](how_tos/summaries_and_tensorboard.md)翻译:([@thylaco1eo](https://github.com/thylaco1eo))√ 校对: ([@lucky521](https://github.com/lucky521)) √
- [TensorBoard:图表可视化](how_tos/graph_viz.md) 翻译:([@Warln](https://github.com/Warln))√ 校对: ([@lucky521](https://github.com/lucky521)) √
- [读取数据](how_tos/reading_data.md) 翻译: ([@volvet](https://github.com/volvet)) 校对: ([@allensummer](http://github.com/allensummer))
- [线程和队列](how_tos/threading_and_queues.md) 翻译: ([@zhangkom](https://github.com/zhangkom)) √ 校对:([@volvet](https://github.com/volvet))√
- [添加新的Op](how_tos/adding_an_op.md) 翻译:([@PFZheng](https://github.com/PFZheng))√校对:([@ZHNathanielLee](https://github.com/ZHNathanielLee)) √
- [自定义数据读取](how_tos/new_data_formats.md) 翻译:([@derekshang](https://github.com/derekshang))√ 校对:([@pengfoo](https://github.com/PengFoo))
- [使用gpu](how_tos/using_gpu.md)翻译:([@lianghyv](https://github.com/lianghyv))√ 校对:([@qiaohaijun](https://github.com/qiaohaijun))
- [共享变量](how_tos/variable_scope.md) 翻译:([@nb312](https://github.com/nb312))√校对:([@pengfoo](https://github.com/PengFoo))
- 资源
- [总览](resources/overview.md) 翻译:([@Jim-Zenn](https://github.com/Jim-Zenn))√ 校对:([@lonlonago](https://github.com/lonlonago)) √
- [BibTex 引用](resources/bib.md) 翻译:([@Jim-Zenn](https://github.com/Jim-Zenn))√ 校对:([@pengfoo](https://github.com/PengFoo))
- [使用示例](resources/uses.md) 翻译:([@andyiac](https://github.com/andyiac))√ 校对([@lonlonago](https://github.com/lonlonago)) √
- [FAQ](resources/faq.md) 翻译:([@Terence Cooper](https://github.com/TerenceCooper))√ 校对:([@pengfoo](https://github.com/PengFoo))
- [术语表](resources/glossary.md) 翻译: ([@leege100](https://github.com/leege100))√ 校对:
([@lonlonago](https://github.com/lonlonago)) √
- [Tensor的阶、形状和数据类型](resources/dims_types.md) 翻译:([@nb312](https://github.com/nb312))√ 校对:([@lonlonago](https://github.com/lonlonago)) √
- 其他
- [常见问题汇总](faq.md)
## 进度记录
- 2015-11-10, 谷歌发布全新人工智能系统TensorFlow并宣布开源, 极客学院Wiki启动协同翻译,创建 GitHub 仓库,制定协同规范
- 2015-11-18, 所有章节认领完毕,翻译完成18章,校对认领7章,Star数361,fork数100,协同翻译QQ群及技术交流群的TF爱好者将近300人,GitHub搜索TensorFlow排名第二
- 2015-12-10, Star数超过500
## TensorFlow 相关资源
- [Google官方Blog宣布TensorFlow开源](https://googleblog.blogspot.com/2015/11/tensorflow-smarter-machine-learning-for.html)
- [TensorFlow WhitePaper(PDF下载)](http://download.tensorflow.org/paper/whitepaper2015.pdf)
- [Jeff Dean 介绍 TensorFlow(视频)](https://www.youtube.com/watch?v=90-S1M7Ny_o&t=21m2s)
- [TensorFlow 简化版接口 Scikit Flow](https://github.com/google/skflow)
- [TensorFlow 使用样例](https://github.com/aymericdamien/TensorFlow-Examples)
- [TensorFlow 与 mxnet, caffe 对比 @chenrudan](http://chenrudan.github.io/blog/2015/11/18/comparethreeopenlib.html)
- [TensorFlow 与 torch7, caffe, mxnet 在内存使用量以及性能对比 @mli](https://github.com/dmlc/mxnet/blob/master/doc/overview_chn.md)
## 感谢支持
## 离线版本
================================================
FILE: SOURCE/api_docs/cc/ClassEnv.md
================================================
# Class `tensorflow::Env` <a class="md-anchor" id="AUTOGENERATED-class--tensorflow--env-"></a>
An interface used by the tensorflow implementation to access operating system functionality like the filesystem etc.
Callers may wish to provide a custom Env object to get fine grain control.
All Env implementations are safe for concurrent access from multiple threads without any external synchronization.
##Member Summary <a class="md-anchor" id="AUTOGENERATED-member-summary"></a>
* [`tensorflow::Env::Env()`](#tensorflow_Env_Env)
* [`virtual tensorflow::Env::~Env()`](#virtual_tensorflow_Env_Env)
* [`virtual Status tensorflow::Env::NewRandomAccessFile(const string &fname, RandomAccessFile **result)=0`](#virtual_Status_tensorflow_Env_NewRandomAccessFile)
* Creates a brand new random access read-only file with the specified name.
* [`virtual Status tensorflow::Env::NewWritableFile(const string &fname, WritableFile **result)=0`](#virtual_Status_tensorflow_Env_NewWritableFile)
* Creates an object that writes to a new file with the specified name.
* [`virtual Status tensorflow::Env::NewAppendableFile(const string &fname, WritableFile **result)=0`](#virtual_Status_tensorflow_Env_NewAppendableFile)
* Creates an object that either appends to an existing file, or writes to a new file (if the file does not exist to begin with).
* [`virtual bool tensorflow::Env::FileExists(const string &fname)=0`](#virtual_bool_tensorflow_Env_FileExists)
* Returns true iff the named file exists.
* [`virtual Status tensorflow::Env::GetChildren(const string &dir, std::vector< string > *result)=0`](#virtual_Status_tensorflow_Env_GetChildren)
* Stores in *result the names of the children of the specified directory. The names are relative to "dir".
* [`virtual Status tensorflow::Env::DeleteFile(const string &fname)=0`](#virtual_Status_tensorflow_Env_DeleteFile)
* Deletes the named file.
* [`virtual Status tensorflow::Env::CreateDir(const string &dirname)=0`](#virtual_Status_tensorflow_Env_CreateDir)
* Creates the specified directory.
* [`virtual Status tensorflow::Env::DeleteDir(const string &dirname)=0`](#virtual_Status_tensorflow_Env_DeleteDir)
* Deletes the specified directory.
* [`virtual Status tensorflow::Env::GetFileSize(const string &fname, uint64 *file_size)=0`](#virtual_Status_tensorflow_Env_GetFileSize)
* Stores the size of fname in *file_size.
* [`virtual Status tensorflow::Env::RenameFile(const string &src, const string &target)=0`](#virtual_Status_tensorflow_Env_RenameFile)
* Renames file src to target. If target already exists, it will be replaced.
* [`virtual uint64 tensorflow::Env::NowMicros()=0`](#virtual_uint64_tensorflow_Env_NowMicros)
* Returns the number of micro-seconds since some fixed point in time. Only useful for computing deltas of time.
* [`virtual void tensorflow::Env::SleepForMicroseconds(int micros)=0`](#virtual_void_tensorflow_Env_SleepForMicroseconds)
* Sleeps/delays the thread for the prescribed number of micro-seconds.
* [`virtual Thread* tensorflow::Env::StartThread(const ThreadOptions &thread_options, const string &name, std::function< void()> fn) TF_MUST_USE_RESULT=0`](#virtual_Thread_tensorflow_Env_StartThread)
* Returns a new thread that is running fn() and is identified (for debugging/performance-analysis) by "name".
* [`static Env* tensorflow::Env::Default()`](#static_Env_tensorflow_Env_Default)
* Returns a default environment suitable for the current operating system.
##Member Details <a class="md-anchor" id="AUTOGENERATED-member-details"></a>
#### `tensorflow::Env::Env()` <a class="md-anchor" id="tensorflow_Env_Env"></a>
#### `virtual tensorflow::Env::~Env()` <a class="md-anchor" id="virtual_tensorflow_Env_Env"></a>
#### `virtual Status tensorflow::Env::NewRandomAccessFile(const string &fname, RandomAccessFile **result)=0` <a class="md-anchor" id="virtual_Status_tensorflow_Env_NewRandomAccessFile"></a>
Creates a brand new random access read-only file with the specified name.
On success, stores a pointer to the new file in *result and returns OK. On failure stores NULL in *result and returns non-OK. If the file does not exist, returns a non-OK status.
The returned file may be concurrently accessed by multiple threads.
#### `virtual Status tensorflow::Env::NewWritableFile(const string &fname, WritableFile **result)=0` <a class="md-anchor" id="virtual_Status_tensorflow_Env_NewWritableFile"></a>
Creates an object that writes to a new file with the specified name.
Deletes any existing file with the same name and creates a new file. On success, stores a pointer to the new file in *result and returns OK. On failure stores NULL in *result and returns non-OK.
The returned file will only be accessed by one thread at a time.
#### `virtual Status tensorflow::Env::NewAppendableFile(const string &fname, WritableFile **result)=0` <a class="md-anchor" id="virtual_Status_tensorflow_Env_NewAppendableFile"></a>
Creates an object that either appends to an existing file, or writes to a new file (if the file does not exist to begin with).
On success, stores a pointer to the new file in *result and returns OK. On failure stores NULL in *result and returns non-OK.
The returned file will only be accessed by one thread at a time.
#### `virtual bool tensorflow::Env::FileExists(const string &fname)=0` <a class="md-anchor" id="virtual_bool_tensorflow_Env_FileExists"></a>
Returns true iff the named file exists.
#### `virtual Status tensorflow::Env::GetChildren(const string &dir, std::vector< string > *result)=0` <a class="md-anchor" id="virtual_Status_tensorflow_Env_GetChildren"></a>
Stores in *result the names of the children of the specified directory. The names are relative to "dir".
Original contents of *results are dropped.
#### `virtual Status tensorflow::Env::DeleteFile(const string &fname)=0` <a class="md-anchor" id="virtual_Status_tensorflow_Env_DeleteFile"></a>
Deletes the named file.
#### `virtual Status tensorflow::Env::CreateDir(const string &dirname)=0` <a class="md-anchor" id="virtual_Status_tensorflow_Env_CreateDir"></a>
Creates the specified directory.
#### `virtual Status tensorflow::Env::DeleteDir(const string &dirname)=0` <a class="md-anchor" id="virtual_Status_tensorflow_Env_DeleteDir"></a>
Deletes the specified directory.
#### `virtual Status tensorflow::Env::GetFileSize(const string &fname, uint64 *file_size)=0` <a class="md-anchor" id="virtual_Status_tensorflow_Env_GetFileSize"></a>
Stores the size of fname in *file_size.
#### `virtual Status tensorflow::Env::RenameFile(const string &src, const string &target)=0` <a class="md-anchor" id="virtual_Status_tensorflow_Env_RenameFile"></a>
Renames file src to target. If target already exists, it will be replaced.
#### `virtual uint64 tensorflow::Env::NowMicros()=0` <a class="md-anchor" id="virtual_uint64_tensorflow_Env_NowMicros"></a>
Returns the number of micro-seconds since some fixed point in time. Only useful for computing deltas of time.
#### `virtual void tensorflow::Env::SleepForMicroseconds(int micros)=0` <a class="md-anchor" id="virtual_void_tensorflow_Env_SleepForMicroseconds"></a>
Sleeps/delays the thread for the prescribed number of micro-seconds.
#### `virtual Thread* tensorflow::Env::StartThread(const ThreadOptions &thread_options, const string &name, std::function< void()> fn) TF_MUST_USE_RESULT=0` <a class="md-anchor" id="virtual_Thread_tensorflow_Env_StartThread"></a>
Returns a new thread that is running fn() and is identified (for debugging/performance-analysis) by "name".
Caller takes ownership of the result and must delete it eventually (the deletion will block until fn() stops running).
#### `static Env* tensorflow::Env::Default()` <a class="md-anchor" id="static_Env_tensorflow_Env_Default"></a>
Returns a default environment suitable for the current operating system.
Sophisticated users may wish to provide their own Env implementation instead of relying on this default environment.
The result of Default() belongs to this library and must never be deleted.
================================================
FILE: SOURCE/api_docs/cc/ClassEnvWrapper.md
================================================
# Class `tensorflow::EnvWrapper` <a class="md-anchor" id="AUTOGENERATED-class--tensorflow--envwrapper-"></a>
An implementation of Env that forwards all calls to another Env .
May be useful to clients who wish to override just part of the functionality of another Env .
##Member Summary <a class="md-anchor" id="AUTOGENERATED-member-summary"></a>
* [`tensorflow::EnvWrapper::EnvWrapper(Env *t)`](#tensorflow_EnvWrapper_EnvWrapper)
* Initializes an EnvWrapper that delegates all calls to *t.
* [`virtual tensorflow::EnvWrapper::~EnvWrapper()`](#virtual_tensorflow_EnvWrapper_EnvWrapper)
* [`Env* tensorflow::EnvWrapper::target() const`](#Env_tensorflow_EnvWrapper_target)
* Returns the target to which this Env forwards all calls.
* [`Status tensorflow::EnvWrapper::NewRandomAccessFile(const string &f, RandomAccessFile **r) override`](#Status_tensorflow_EnvWrapper_NewRandomAccessFile)
* Creates a brand new random access read-only file with the specified name.
* [`Status tensorflow::EnvWrapper::NewWritableFile(const string &f, WritableFile **r) override`](#Status_tensorflow_EnvWrapper_NewWritableFile)
* Creates an object that writes to a new file with the specified name.
* [`Status tensorflow::EnvWrapper::NewAppendableFile(const string &f, WritableFile **r) override`](#Status_tensorflow_EnvWrapper_NewAppendableFile)
* Creates an object that either appends to an existing file, or writes to a new file (if the file does not exist to begin with).
* [`bool tensorflow::EnvWrapper::FileExists(const string &f) override`](#bool_tensorflow_EnvWrapper_FileExists)
* Returns true iff the named file exists.
* [`Status tensorflow::EnvWrapper::GetChildren(const string &dir, std::vector< string > *r) override`](#Status_tensorflow_EnvWrapper_GetChildren)
* Stores in *result the names of the children of the specified directory. The names are relative to "dir".
* [`Status tensorflow::EnvWrapper::DeleteFile(const string &f) override`](#Status_tensorflow_EnvWrapper_DeleteFile)
* Deletes the named file.
* [`Status tensorflow::EnvWrapper::CreateDir(const string &d) override`](#Status_tensorflow_EnvWrapper_CreateDir)
* Creates the specified directory.
* [`Status tensorflow::EnvWrapper::DeleteDir(const string &d) override`](#Status_tensorflow_EnvWrapper_DeleteDir)
* Deletes the specified directory.
* [`Status tensorflow::EnvWrapper::GetFileSize(const string &f, uint64 *s) override`](#Status_tensorflow_EnvWrapper_GetFileSize)
* Stores the size of fname in *file_size.
* [`Status tensorflow::EnvWrapper::RenameFile(const string &s, const string &t) override`](#Status_tensorflow_EnvWrapper_RenameFile)
* Renames file src to target. If target already exists, it will be replaced.
* [`uint64 tensorflow::EnvWrapper::NowMicros() override`](#uint64_tensorflow_EnvWrapper_NowMicros)
* Returns the number of micro-seconds since some fixed point in time. Only useful for computing deltas of time.
* [`void tensorflow::EnvWrapper::SleepForMicroseconds(int micros) override`](#void_tensorflow_EnvWrapper_SleepForMicroseconds)
* Sleeps/delays the thread for the prescribed number of micro-seconds.
* [`Thread* tensorflow::EnvWrapper::StartThread(const ThreadOptions &thread_options, const string &name, std::function< void()> fn) override`](#Thread_tensorflow_EnvWrapper_StartThread)
* Returns a new thread that is running fn() and is identified (for debugging/performance-analysis) by "name".
##Member Details <a class="md-anchor" id="AUTOGENERATED-member-details"></a>
#### `tensorflow::EnvWrapper::EnvWrapper(Env *t)` <a class="md-anchor" id="tensorflow_EnvWrapper_EnvWrapper"></a>
Initializes an EnvWrapper that delegates all calls to *t.
#### `virtual tensorflow::EnvWrapper::~EnvWrapper()` <a class="md-anchor" id="virtual_tensorflow_EnvWrapper_EnvWrapper"></a>
#### `Env* tensorflow::EnvWrapper::target() const` <a class="md-anchor" id="Env_tensorflow_EnvWrapper_target"></a>
Returns the target to which this Env forwards all calls.
#### `Status tensorflow::EnvWrapper::NewRandomAccessFile(const string &f, RandomAccessFile **r) override` <a class="md-anchor" id="Status_tensorflow_EnvWrapper_NewRandomAccessFile"></a>
Creates a brand new random access read-only file with the specified name.
On success, stores a pointer to the new file in *result and returns OK. On failure stores NULL in *result and returns non-OK. If the file does not exist, returns a non-OK status.
The returned file may be concurrently accessed by multiple threads.
#### `Status tensorflow::EnvWrapper::NewWritableFile(const string &f, WritableFile **r) override` <a class="md-anchor" id="Status_tensorflow_EnvWrapper_NewWritableFile"></a>
Creates an object that writes to a new file with the specified name.
Deletes any existing file with the same name and creates a new file. On success, stores a pointer to the new file in *result and returns OK. On failure stores NULL in *result and returns non-OK.
The returned file will only be accessed by one thread at a time.
#### `Status tensorflow::EnvWrapper::NewAppendableFile(const string &f, WritableFile **r) override` <a class="md-anchor" id="Status_tensorflow_EnvWrapper_NewAppendableFile"></a>
Creates an object that either appends to an existing file, or writes to a new file (if the file does not exist to begin with).
On success, stores a pointer to the new file in *result and returns OK. On failure stores NULL in *result and returns non-OK.
The returned file will only be accessed by one thread at a time.
#### `bool tensorflow::EnvWrapper::FileExists(const string &f) override` <a class="md-anchor" id="bool_tensorflow_EnvWrapper_FileExists"></a>
Returns true iff the named file exists.
#### `Status tensorflow::EnvWrapper::GetChildren(const string &dir, std::vector< string > *r) override` <a class="md-anchor" id="Status_tensorflow_EnvWrapper_GetChildren"></a>
Stores in *result the names of the children of the specified directory. The names are relative to "dir".
Original contents of *results are dropped.
#### `Status tensorflow::EnvWrapper::DeleteFile(const string &f) override` <a class="md-anchor" id="Status_tensorflow_EnvWrapper_DeleteFile"></a>
Deletes the named file.
#### `Status tensorflow::EnvWrapper::CreateDir(const string &d) override` <a class="md-anchor" id="Status_tensorflow_EnvWrapper_CreateDir"></a>
Creates the specified directory.
#### `Status tensorflow::EnvWrapper::DeleteDir(const string &d) override` <a class="md-anchor" id="Status_tensorflow_EnvWrapper_DeleteDir"></a>
Deletes the specified directory.
#### `Status tensorflow::EnvWrapper::GetFileSize(const string &f, uint64 *s) override` <a class="md-anchor" id="Status_tensorflow_EnvWrapper_GetFileSize"></a>
Stores the size of fname in *file_size.
#### `Status tensorflow::EnvWrapper::RenameFile(const string &s, const string &t) override` <a class="md-anchor" id="Status_tensorflow_EnvWrapper_RenameFile"></a>
Renames file src to target. If target already exists, it will be replaced.
#### `uint64 tensorflow::EnvWrapper::NowMicros() override` <a class="md-anchor" id="uint64_tensorflow_EnvWrapper_NowMicros"></a>
Returns the number of micro-seconds since some fixed point in time. Only useful for computing deltas of time.
#### `void tensorflow::EnvWrapper::SleepForMicroseconds(int micros) override` <a class="md-anchor" id="void_tensorflow_EnvWrapper_SleepForMicroseconds"></a>
Sleeps/delays the thread for the prescribed number of micro-seconds.
#### `Thread* tensorflow::EnvWrapper::StartThread(const ThreadOptions &thread_options, const string &name, std::function< void()> fn) override` <a class="md-anchor" id="Thread_tensorflow_EnvWrapper_StartThread"></a>
Returns a new thread that is running fn() and is identified (for debugging/performance-analysis) by "name".
Caller takes ownership of the result and must delete it eventually (the deletion will block until fn() stops running).
================================================
FILE: SOURCE/api_docs/cc/ClassRandomAccessFile.md
================================================
# Class `tensorflow::RandomAccessFile` <a class="md-anchor" id="AUTOGENERATED-class--tensorflow--randomaccessfile-"></a>
A file abstraction for randomly reading the contents of a file.
##Member Summary <a class="md-anchor" id="AUTOGENERATED-member-summary"></a>
* [`tensorflow::RandomAccessFile::RandomAccessFile()`](#tensorflow_RandomAccessFile_RandomAccessFile)
* [`virtual tensorflow::RandomAccessFile::~RandomAccessFile()`](#virtual_tensorflow_RandomAccessFile_RandomAccessFile)
* [`virtual Status tensorflow::RandomAccessFile::Read(uint64 offset, size_t n, StringPiece *result, char *scratch) const =0`](#virtual_Status_tensorflow_RandomAccessFile_Read)
* Reads up to "n" bytes from the file starting at "offset".
##Member Details <a class="md-anchor" id="AUTOGENERATED-member-details"></a>
#### `tensorflow::RandomAccessFile::RandomAccessFile()` <a class="md-anchor" id="tensorflow_RandomAccessFile_RandomAccessFile"></a>
#### `virtual tensorflow::RandomAccessFile::~RandomAccessFile()` <a class="md-anchor" id="virtual_tensorflow_RandomAccessFile_RandomAccessFile"></a>
#### `virtual Status tensorflow::RandomAccessFile::Read(uint64 offset, size_t n, StringPiece *result, char *scratch) const =0` <a class="md-anchor" id="virtual_Status_tensorflow_RandomAccessFile_Read"></a>
Reads up to "n" bytes from the file starting at "offset".
"scratch[0..n-1]" may be written by this routine. Sets "*result" to the data that was read (including if fewer than "n" bytes were successfully read). May set "*result" to point at data in "scratch[0..n-1]", so "scratch[0..n-1]" must be live when "*result" is used.
On OK returned status: "n" bytes have been stored in "*result". On non-OK returned status: [0..n] bytes have been stored in "*result".
Returns `OUT_OF_RANGE` if fewer than n bytes were stored in "*result" because of EOF.
Safe for concurrent use by multiple threads.
================================================
FILE: SOURCE/api_docs/cc/ClassSession.md
================================================
# Class `tensorflow::Session` <a class="md-anchor" id="AUTOGENERATED-class--tensorflow--session-"></a>
A Session instance lets a caller drive a TensorFlow graph computation.
When a Session is created with a given target, a new Session object is bound to the universe of resources specified by that target. Those resources are available to this session to perform computation described in the GraphDef. After extending the session with a graph, the caller uses the Run() API to perform the computation and potentially fetch outputs as Tensors.
Example:
```c++ tensorflow::GraphDef graph;
// ... Create or load graph into "graph".
// This example uses the default options which connects
// to a local runtime.
tensorflow::SessionOptions options;
std::unique_ptr<tensorflow::Session>
session(tensorflow::NewSession(options));
// Create the session with this graph.
tensorflow::Status s = session->Create(graph);
if (!s.ok()) { ... }
// Run the graph and fetch the first output of the "output"
// operation, and also run to but do not return anything
// for the "update_state" operation.
std::vector<tensorflow::Tensor> outputs;
s = session->Run({}, {"output:0"}, {"update_state"}, &outputs);
if (!s.ok()) { ... }
// Map the output as a flattened float tensor, and do something
// with it.
auto output_tensor = outputs[0].flat<float>();
if (output_tensor(0) > 0.5) { ... }
// Close the session to release the resources associated with
// this session.
session->Close()
```
A Session allows concurrent calls to Run() , though a Session must be created / extended by a single thread.
Only one thread must call Close() , and Close() must only be called after all other calls to Run() have returned.
##Member Summary <a class="md-anchor" id="AUTOGENERATED-member-summary"></a>
* [`virtual Status tensorflow::Session::Create(const GraphDef &graph)=0`](#virtual_Status_tensorflow_Session_Create)
* Create the graph to be used for the session.
* [`virtual Status tensorflow::Session::Extend(const GraphDef &graph)=0`](#virtual_Status_tensorflow_Session_Extend)
* Adds operations to the graph that is already registered with the Session .
* [`virtual Status tensorflow::Session::Run(const std::vector< std::pair< string, Tensor > > &inputs, const std::vector< string > &output_tensor_names, const std::vector< string > &target_node_names, std::vector< Tensor > *outputs)=0`](#virtual_Status_tensorflow_Session_Run)
* Runs the graph with the provided input tensors and fills `outputs` for the endpoints specified in `output_tensor_names`. Runs to but does not return Tensors for the nodes in `target_node_names`.
* [`virtual Status tensorflow::Session::Close()=0`](#virtual_Status_tensorflow_Session_Close)
* Closes this session.
* [`virtual tensorflow::Session::~Session()`](#virtual_tensorflow_Session_Session)
##Member Details <a class="md-anchor" id="AUTOGENERATED-member-details"></a>
#### `virtual Status tensorflow::Session::Create(const GraphDef &graph)=0` <a class="md-anchor" id="virtual_Status_tensorflow_Session_Create"></a>
Create the graph to be used for the session.
Returns an error if this session has already been created with a graph. To re-use the session with a different graph, the caller must Close() the session first.
#### `virtual Status tensorflow::Session::Extend(const GraphDef &graph)=0` <a class="md-anchor" id="virtual_Status_tensorflow_Session_Extend"></a>
Adds operations to the graph that is already registered with the Session .
The names of new operations in "graph" must not exist in the graph that is already registered.
#### `virtual Status tensorflow::Session::Run(const std::vector< std::pair< string, Tensor > > &inputs, const std::vector< string > &output_tensor_names, const std::vector< string > &target_node_names, std::vector< Tensor > *outputs)=0` <a class="md-anchor" id="virtual_Status_tensorflow_Session_Run"></a>
Runs the graph with the provided input tensors and fills `outputs` for the endpoints specified in `output_tensor_names`. Runs to but does not return Tensors for the nodes in `target_node_names`.
The order of tensors in `outputs` will match the order provided by `output_tensor_names`.
If `Run` returns `OK()`, then `outputs->size()` will be equal to `output_tensor_names.size()`. If `Run` does not return `OK()`, the state of `outputs` is undefined.
REQUIRES: The name of each Tensor of the input or output must match a "Tensor endpoint" in the `GraphDef` passed to ` Create() `.
REQUIRES: outputs is not nullptr if `output_tensor_names` is non-empty.
#### `virtual Status tensorflow::Session::Close()=0` <a class="md-anchor" id="virtual_Status_tensorflow_Session_Close"></a>
Closes this session.
Closing a session releases the resources used by this session on the TensorFlow runtime (specified during session creation by the ` SessionOptions::target ` field).
#### `virtual tensorflow::Session::~Session()` <a class="md-anchor" id="virtual_tensorflow_Session_Session"></a>
================================================
FILE: SOURCE/api_docs/cc/ClassStatus.md
================================================
# Class `tensorflow::Status` <a class="md-anchor" id="AUTOGENERATED-class--tensorflow--status-"></a>
##Member Summary <a class="md-anchor" id="AUTOGENERATED-member-summary"></a>
* [`tensorflow::Status::Status()`](#tensorflow_Status_Status)
* Create a success status.
* [`tensorflow::Status::~Status()`](#tensorflow_Status_Status)
* [`tensorflow::Status::Status(tensorflow::error::Code code, tensorflow::StringPiece msg)`](#tensorflow_Status_Status)
* Create a status with the specified error code and msg as a human-readable string containing more detailed information.
* [`tensorflow::Status::Status(const Status &s)`](#tensorflow_Status_Status)
* Copy the specified status.
* [`void tensorflow::Status::operator=(const Status &s)`](#void_tensorflow_Status_operator_)
* [`bool tensorflow::Status::ok() const`](#bool_tensorflow_Status_ok)
* Returns true iff the status indicates success.
* [`tensorflow::error::Code tensorflow::Status::code() const`](#tensorflow_error_Code_tensorflow_Status_code)
* [`const string& tensorflow::Status::error_message() const`](#const_string_tensorflow_Status_error_message)
* [`bool tensorflow::Status::operator==(const Status &x) const`](#bool_tensorflow_Status_operator_)
* [`bool tensorflow::Status::operator!=(const Status &x) const`](#bool_tensorflow_Status_operator_)
* [`void tensorflow::Status::Update(const Status &new_status)`](#void_tensorflow_Status_Update)
* If ` ok() `, stores `new_status` into `*this`. If `!ok()`, preserves the current status, but may augment with additional information about `new_status`.
* [`string tensorflow::Status::ToString() const`](#string_tensorflow_Status_ToString)
* Return a string representation of this status suitable for printing. Returns the string `"OK"` for success.
* [`static Status tensorflow::Status::OK()`](#static_Status_tensorflow_Status_OK)
##Member Details <a class="md-anchor" id="AUTOGENERATED-member-details"></a>
#### `tensorflow::Status::Status()` <a class="md-anchor" id="tensorflow_Status_Status"></a>
Create a success status.
#### `tensorflow::Status::~Status()` <a class="md-anchor" id="tensorflow_Status_Status"></a>
#### `tensorflow::Status::Status(tensorflow::error::Code code, tensorflow::StringPiece msg)` <a class="md-anchor" id="tensorflow_Status_Status"></a>
Create a status with the specified error code and msg as a human-readable string containing more detailed information.
#### `tensorflow::Status::Status(const Status &s)` <a class="md-anchor" id="tensorflow_Status_Status"></a>
Copy the specified status.
#### `void tensorflow::Status::operator=(const Status &s)` <a class="md-anchor" id="void_tensorflow_Status_operator_"></a>
#### `bool tensorflow::Status::ok() const` <a class="md-anchor" id="bool_tensorflow_Status_ok"></a>
Returns true iff the status indicates success.
#### `tensorflow::error::Code tensorflow::Status::code() const` <a class="md-anchor" id="tensorflow_error_Code_tensorflow_Status_code"></a>
#### `const string& tensorflow::Status::error_message() const` <a class="md-anchor" id="const_string_tensorflow_Status_error_message"></a>
#### `bool tensorflow::Status::operator==(const Status &x) const` <a class="md-anchor" id="bool_tensorflow_Status_operator_"></a>
#### `bool tensorflow::Status::operator!=(const Status &x) const` <a class="md-anchor" id="bool_tensorflow_Status_operator_"></a>
#### `void tensorflow::Status::Update(const Status &new_status)` <a class="md-anchor" id="void_tensorflow_Status_Update"></a>
If ` ok() `, stores `new_status` into `*this`. If `!ok()`, preserves the current status, but may augment with additional information about `new_status`.
Convenient way of keeping track of the first error encountered. Instead of: `if (overall_status.ok()) overall_status = new_status` Use: `overall_status.Update(new_status);`
#### `string tensorflow::Status::ToString() const` <a class="md-anchor" id="string_tensorflow_Status_ToString"></a>
Return a string representation of this status suitable for printing. Returns the string `"OK"` for success.
#### `static Status tensorflow::Status::OK()` <a class="md-anchor" id="static_Status_tensorflow_Status_OK"></a>
================================================
FILE: SOURCE/api_docs/cc/ClassTensor.md
================================================
# Class `tensorflow::Tensor` <a class="md-anchor" id="AUTOGENERATED-class--tensorflow--tensor-"></a>
Represents an n-dimensional array of values.
##Member Summary <a class="md-anchor" id="AUTOGENERATED-member-summary"></a>
* [`tensorflow::Tensor::Tensor()`](#tensorflow_Tensor_Tensor)
* Default Tensor constructor. Creates a 1-dimension, 0-element float tensor.
* [`tensorflow::Tensor::Tensor(DataType type, const TensorShape &shape)`](#tensorflow_Tensor_Tensor)
* Creates a Tensor of the given `type` and `shape`.
* [`tensorflow::Tensor::Tensor(Allocator *a, DataType type, const TensorShape &shape)`](#tensorflow_Tensor_Tensor)
* Creates a tensor with the input `type` and `shape`, using the allocator `a` to allocate the underlying buffer.
* [`tensorflow::Tensor::Tensor(DataType type)`](#tensorflow_Tensor_Tensor)
* Creates an uninitialized Tensor of the given data type.
* [`tensorflow::Tensor::Tensor(const Tensor &other)`](#tensorflow_Tensor_Tensor)
* [`tensorflow::Tensor::~Tensor()`](#tensorflow_Tensor_Tensor)
* Copy constructor.
* [`DataType tensorflow::Tensor::dtype() const`](#DataType_tensorflow_Tensor_dtype)
* Returns the data type.
* [`const TensorShape& tensorflow::Tensor::shape() const`](#const_TensorShape_tensorflow_Tensor_shape)
* Returns the shape of the tensor.
* [`int tensorflow::Tensor::dims() const`](#int_tensorflow_Tensor_dims)
* Convenience accessor for the tensor shape.
* [`int64 tensorflow::Tensor::dim_size(int d) const`](#int64_tensorflow_Tensor_dim_size)
* Convenience accessor for the tensor shape.
* [`int64 tensorflow::Tensor::NumElements() const`](#int64_tensorflow_Tensor_NumElements)
* Convenience accessor for the tensor shape.
* [`bool tensorflow::Tensor::IsSameSize(const Tensor &b) const`](#bool_tensorflow_Tensor_IsSameSize)
* [`bool tensorflow::Tensor::IsInitialized() const`](#bool_tensorflow_Tensor_IsInitialized)
* Has this Tensor been initialized?
* [`size_t tensorflow::Tensor::TotalBytes() const`](#size_t_tensorflow_Tensor_TotalBytes)
* Returns the estimated memory usage of this tensor.
* [`Tensor& tensorflow::Tensor::operator=(const Tensor &other)`](#Tensor_tensorflow_Tensor_operator_)
* Assign operator. This tensor shares other's underlying storage.
* [`bool tensorflow::Tensor::CopyFrom(const Tensor &other, const TensorShape &shape) TF_MUST_USE_RESULT`](#bool_tensorflow_Tensor_CopyFrom)
* Copy the other tensor into this tensor and reshape it.
* [`Tensor tensorflow::Tensor::Slice(int64 dim0_start, int64 dim0_limit) const`](#Tensor_tensorflow_Tensor_Slice)
* Slice this tensor along the 1st dimension.
* [`bool tensorflow::Tensor::FromProto(const TensorProto &other) TF_MUST_USE_RESULT`](#bool_tensorflow_Tensor_FromProto)
* Parse `other` and construct the tensor.
* [`bool tensorflow::Tensor::FromProto(Allocator *a, const TensorProto &other) TF_MUST_USE_RESULT`](#bool_tensorflow_Tensor_FromProto)
* [`void tensorflow::Tensor::AsProtoField(TensorProto *proto) const`](#void_tensorflow_Tensor_AsProtoField)
* Fills in `proto` with `*this` tensor's content.
* [`void tensorflow::Tensor::AsProtoTensorContent(TensorProto *proto) const`](#void_tensorflow_Tensor_AsProtoTensorContent)
* [`TTypes<T>::Vec tensorflow::Tensor::vec()`](#TTypes_T_Vec_tensorflow_Tensor_vec)
* Return the tensor data as an `Eigen::Tensor` with the type and sizes of this ` Tensor `.
* [`TTypes<T>::Matrix tensorflow::Tensor::matrix()`](#TTypes_T_Matrix_tensorflow_Tensor_matrix)
* [`TTypes< T, NDIMS >::Tensor tensorflow::Tensor::tensor()`](#TTypes_T_NDIMS_Tensor_tensorflow_Tensor_tensor)
* [`TTypes<T>::Flat tensorflow::Tensor::flat()`](#TTypes_T_Flat_tensorflow_Tensor_flat)
* Return the tensor data as an `Eigen::Tensor` of the data type and a specified shape.
* [`TTypes<T>::UnalignedFlat tensorflow::Tensor::unaligned_flat()`](#TTypes_T_UnalignedFlat_tensorflow_Tensor_unaligned_flat)
* [`TTypes<T>::Matrix tensorflow::Tensor::flat_inner_dims()`](#TTypes_T_Matrix_tensorflow_Tensor_flat_inner_dims)
* [`TTypes<T>::Matrix tensorflow::Tensor::flat_outer_dims()`](#TTypes_T_Matrix_tensorflow_Tensor_flat_outer_dims)
* [`TTypes< T, NDIMS >::Tensor tensorflow::Tensor::shaped(gtl::ArraySlice< int64 > new_sizes)`](#TTypes_T_NDIMS_Tensor_tensorflow_Tensor_shaped)
* [`TTypes< T, NDIMS >::UnalignedTensor tensorflow::Tensor::unaligned_shaped(gtl::ArraySlice< int64 > new_sizes)`](#TTypes_T_NDIMS_UnalignedTensor_tensorflow_Tensor_unaligned_shaped)
* [`TTypes< T >::Scalar tensorflow::Tensor::scalar()`](#TTypes_T_Scalar_tensorflow_Tensor_scalar)
* Return the Tensor data as a `TensorMap` of fixed size 1: `TensorMap<TensorFixedSize<T, 1>>`.
* [`TTypes<T>::ConstVec tensorflow::Tensor::vec() const`](#TTypes_T_ConstVec_tensorflow_Tensor_vec)
* Const versions of all the methods above.
* [`TTypes<T>::ConstMatrix tensorflow::Tensor::matrix() const`](#TTypes_T_ConstMatrix_tensorflow_Tensor_matrix)
* [`TTypes< T, NDIMS >::ConstTensor tensorflow::Tensor::tensor() const`](#TTypes_T_NDIMS_ConstTensor_tensorflow_Tensor_tensor)
* [`TTypes<T>::ConstFlat tensorflow::Tensor::flat() const`](#TTypes_T_ConstFlat_tensorflow_Tensor_flat)
* [`TTypes<T>::UnalignedConstFlat tensorflow::Tensor::unaligned_flat() const`](#TTypes_T_UnalignedConstFlat_tensorflow_Tensor_unaligned_flat)
* [`TTypes<T>::ConstMatrix tensorflow::Tensor::flat_inner_dims() const`](#TTypes_T_ConstMatrix_tensorflow_Tensor_flat_inner_dims)
* [`TTypes<T>::ConstMatrix tensorflow::Tensor::flat_outer_dims() const`](#TTypes_T_ConstMatrix_tensorflow_Tensor_flat_outer_dims)
* [`TTypes< T, NDIMS >::ConstTensor tensorflow::Tensor::shaped(gtl::ArraySlice< int64 > new_sizes) const`](#TTypes_T_NDIMS_ConstTensor_tensorflow_Tensor_shaped)
* [`TTypes< T, NDIMS >::UnalignedConstTensor tensorflow::Tensor::unaligned_shaped(gtl::ArraySlice< int64 > new_sizes) const`](#TTypes_T_NDIMS_UnalignedConstTensor_tensorflow_Tensor_unaligned_shaped)
* [`TTypes< T >::ConstScalar tensorflow::Tensor::scalar() const`](#TTypes_T_ConstScalar_tensorflow_Tensor_scalar)
* [`string tensorflow::Tensor::SummarizeValue(int64 max_entries) const`](#string_tensorflow_Tensor_SummarizeValue)
* Render the first `max_entries` values in `*this` into a string.
* [`string tensorflow::Tensor::DebugString() const`](#string_tensorflow_Tensor_DebugString)
* A human-readable summary of the tensor suitable for debugging.
* [`void tensorflow::Tensor::FillDescription(TensorDescription *description) const`](#void_tensorflow_Tensor_FillDescription)
* [`StringPiece tensorflow::Tensor::tensor_data() const`](#StringPiece_tensorflow_Tensor_tensor_data)
* Returns a `StringPiece` mapping the current tensor's buffer.
##Member Details <a class="md-anchor" id="AUTOGENERATED-member-details"></a>
#### `tensorflow::Tensor::Tensor()` <a class="md-anchor" id="tensorflow_Tensor_Tensor"></a>
Default Tensor constructor. Creates a 1-dimension, 0-element float tensor.
#### `tensorflow::Tensor::Tensor(DataType type, const TensorShape &shape)` <a class="md-anchor" id="tensorflow_Tensor_Tensor"></a>
Creates a Tensor of the given `type` and `shape`.
The underlying buffer is allocated using a `CPUAllocator`.
#### `tensorflow::Tensor::Tensor(Allocator *a, DataType type, const TensorShape &shape)` <a class="md-anchor" id="tensorflow_Tensor_Tensor"></a>
Creates a tensor with the input `type` and `shape`, using the allocator `a` to allocate the underlying buffer.
`a` must outlive the lifetime of this Tensor .
#### `tensorflow::Tensor::Tensor(DataType type)` <a class="md-anchor" id="tensorflow_Tensor_Tensor"></a>
Creates an uninitialized Tensor of the given data type.
#### `tensorflow::Tensor::Tensor(const Tensor &other)` <a class="md-anchor" id="tensorflow_Tensor_Tensor"></a>
#### `tensorflow::Tensor::~Tensor()` <a class="md-anchor" id="tensorflow_Tensor_Tensor"></a>
Copy constructor.
#### `DataType tensorflow::Tensor::dtype() const` <a class="md-anchor" id="DataType_tensorflow_Tensor_dtype"></a>
Returns the data type.
#### `const TensorShape& tensorflow::Tensor::shape() const` <a class="md-anchor" id="const_TensorShape_tensorflow_Tensor_shape"></a>
Returns the shape of the tensor.
#### `int tensorflow::Tensor::dims() const` <a class="md-anchor" id="int_tensorflow_Tensor_dims"></a>
Convenience accessor for the tensor shape.
For all shape accessors, see comments for relevant methods of ` TensorShape ` in ` tensor_shape.h `.
#### `int64 tensorflow::Tensor::dim_size(int d) const` <a class="md-anchor" id="int64_tensorflow_Tensor_dim_size"></a>
Convenience accessor for the tensor shape.
#### `int64 tensorflow::Tensor::NumElements() const` <a class="md-anchor" id="int64_tensorflow_Tensor_NumElements"></a>
Convenience accessor for the tensor shape.
#### `bool tensorflow::Tensor::IsSameSize(const Tensor &b) const` <a class="md-anchor" id="bool_tensorflow_Tensor_IsSameSize"></a>
#### `bool tensorflow::Tensor::IsInitialized() const` <a class="md-anchor" id="bool_tensorflow_Tensor_IsInitialized"></a>
Has this Tensor been initialized?
#### `size_t tensorflow::Tensor::TotalBytes() const` <a class="md-anchor" id="size_t_tensorflow_Tensor_TotalBytes"></a>
Returns the estimated memory usage of this tensor.
#### `Tensor& tensorflow::Tensor::operator=(const Tensor &other)` <a class="md-anchor" id="Tensor_tensorflow_Tensor_operator_"></a>
Assign operator. This tensor shares other's underlying storage.
#### `bool tensorflow::Tensor::CopyFrom(const Tensor &other, const TensorShape &shape) TF_MUST_USE_RESULT` <a class="md-anchor" id="bool_tensorflow_Tensor_CopyFrom"></a>
Copy the other tensor into this tensor and reshape it.
This tensor shares other's underlying storage. Returns `true` iff `other.shape()` has the same number of elements of the given `shape`.
#### `Tensor tensorflow::Tensor::Slice(int64 dim0_start, int64 dim0_limit) const` <a class="md-anchor" id="Tensor_tensorflow_Tensor_Slice"></a>
Slice this tensor along the 1st dimension.
I.e., the returned tensor satisifies returned[i, ...] == this[dim0_start + i, ...]. The returned tensor shares the underlying tensor buffer with this tensor.
NOTE: The returned tensor may not satisfies the same alignment requirement as this tensor depending on the shape. The caller must check the returned tensor's alignment before calling certain methods that have alignment requirement (e.g., ` flat() `, `tensor()`).
REQUIRES: ` dims() ` >= 1 REQUIRES: `0 <= dim0_start <= dim0_limit <= dim_size(0)`
#### `bool tensorflow::Tensor::FromProto(const TensorProto &other) TF_MUST_USE_RESULT` <a class="md-anchor" id="bool_tensorflow_Tensor_FromProto"></a>
Parse `other` and construct the tensor.
Returns `true` iff the parsing succeeds. If the parsing fails, the state of `*this` is unchanged.
#### `bool tensorflow::Tensor::FromProto(Allocator *a, const TensorProto &other) TF_MUST_USE_RESULT` <a class="md-anchor" id="bool_tensorflow_Tensor_FromProto"></a>
#### `void tensorflow::Tensor::AsProtoField(TensorProto *proto) const` <a class="md-anchor" id="void_tensorflow_Tensor_AsProtoField"></a>
Fills in `proto` with `*this` tensor's content.
` AsProtoField() ` fills in the repeated field for `proto.dtype()`, while `AsProtoTensorContent()` encodes the content in `proto.tensor_content()` in a compact form.
#### `void tensorflow::Tensor::AsProtoTensorContent(TensorProto *proto) const` <a class="md-anchor" id="void_tensorflow_Tensor_AsProtoTensorContent"></a>
#### `TTypes<T>::Vec tensorflow::Tensor::vec()` <a class="md-anchor" id="TTypes_T_Vec_tensorflow_Tensor_vec"></a>
Return the tensor data as an `Eigen::Tensor` with the type and sizes of this ` Tensor `.
Use these methods when you know the data type and the number of dimensions of the Tensor and you want an `Eigen::Tensor` automatically sized to the ` Tensor ` sizes. The implementation check fails if either type or sizes mismatch.
Example:
```c++ typedef float T;
Tensor my_mat(...built with Shape{rows: 3, cols: 5}...);
auto mat = my_mat.matrix<T>(); // 2D Eigen::Tensor, 3 x 5.
auto mat = my_mat.tensor<T, 2>(); // 2D Eigen::Tensor, 3 x 5.
auto vec = my_mat.vec<T>(); // CHECK fails as my_mat is 2D.
auto vec = my_mat.tensor<T, 3>(); // CHECK fails as my_mat is 2D.
auto mat = my_mat.matrix<int32>();// CHECK fails as type mismatch.
```
#### `TTypes<T>::Matrix tensorflow::Tensor::matrix()` <a class="md-anchor" id="TTypes_T_Matrix_tensorflow_Tensor_matrix"></a>
#### `TTypes< T, NDIMS >::Tensor tensorflow::Tensor::tensor()` <a class="md-anchor" id="TTypes_T_NDIMS_Tensor_tensorflow_Tensor_tensor"></a>
#### `TTypes<T>::Flat tensorflow::Tensor::flat()` <a class="md-anchor" id="TTypes_T_Flat_tensorflow_Tensor_flat"></a>
Return the tensor data as an `Eigen::Tensor` of the data type and a specified shape.
These methods allow you to access the data with the dimensions and sizes of your choice. You do not need to know the number of dimensions of the Tensor to call them. However, they `CHECK` that the type matches and the dimensions requested creates an `Eigen::Tensor` with the same number of elements as the tensor.
Example:
```c++ typedef float T;
Tensor my_ten(...built with Shape{planes: 4, rows: 3, cols: 5}...);
// 1D Eigen::Tensor, size 60:
auto flat = my_ten.flat<T>();
// 2D Eigen::Tensor 12 x 5:
auto inner = my_ten.flat_inner_dims<T>();
// 2D Eigen::Tensor 4 x 15:
auto outer = my_ten.shaped<T, 2>({4, 15});
// CHECK fails, bad num elements:
auto outer = my_ten.shaped<T, 2>({4, 8});
// 3D Eigen::Tensor 6 x 5 x 2:
auto weird = my_ten.shaped<T, 3>({6, 5, 2});
// CHECK fails, type mismatch:
auto bad = my_ten.flat<int32>();
```
#### `TTypes<T>::UnalignedFlat tensorflow::Tensor::unaligned_flat()` <a class="md-anchor" id="TTypes_T_UnalignedFlat_tensorflow_Tensor_unaligned_flat"></a>
#### `TTypes<T>::Matrix tensorflow::Tensor::flat_inner_dims()` <a class="md-anchor" id="TTypes_T_Matrix_tensorflow_Tensor_flat_inner_dims"></a>
Returns the data as an Eigen::Tensor with 2 dimensions, collapsing all Tensor dimensions but the last one into the first dimension of the result.
#### `TTypes<T>::Matrix tensorflow::Tensor::flat_outer_dims()` <a class="md-anchor" id="TTypes_T_Matrix_tensorflow_Tensor_flat_outer_dims"></a>
Returns the data as an Eigen::Tensor with 2 dimensions, collapsing all Tensor dimensions but the first one into the last dimension of the result.
#### `TTypes< T, NDIMS >::Tensor tensorflow::Tensor::shaped(gtl::ArraySlice< int64 > new_sizes)` <a class="md-anchor" id="TTypes_T_NDIMS_Tensor_tensorflow_Tensor_shaped"></a>
#### `TTypes< T, NDIMS >::UnalignedTensor tensorflow::Tensor::unaligned_shaped(gtl::ArraySlice< int64 > new_sizes)` <a class="md-anchor" id="TTypes_T_NDIMS_UnalignedTensor_tensorflow_Tensor_unaligned_shaped"></a>
#### `TTypes< T >::Scalar tensorflow::Tensor::scalar()` <a class="md-anchor" id="TTypes_T_Scalar_tensorflow_Tensor_scalar"></a>
Return the Tensor data as a `TensorMap` of fixed size 1: `TensorMap<TensorFixedSize<T, 1>>`.
Using ` scalar() ` allows the compiler to perform optimizations as the size of the tensor is known at compile time.
#### `TTypes<T>::ConstVec tensorflow::Tensor::vec() const` <a class="md-anchor" id="TTypes_T_ConstVec_tensorflow_Tensor_vec"></a>
Const versions of all the methods above.
#### `TTypes<T>::ConstMatrix tensorflow::Tensor::matrix() const` <a class="md-anchor" id="TTypes_T_ConstMatrix_tensorflow_Tensor_matrix"></a>
#### `TTypes< T, NDIMS >::ConstTensor tensorflow::Tensor::tensor() const` <a class="md-anchor" id="TTypes_T_NDIMS_ConstTensor_tensorflow_Tensor_tensor"></a>
#### `TTypes<T>::ConstFlat tensorflow::Tensor::flat() const` <a class="md-anchor" id="TTypes_T_ConstFlat_tensorflow_Tensor_flat"></a>
#### `TTypes<T>::UnalignedConstFlat tensorflow::Tensor::unaligned_flat() const` <a class="md-anchor" id="TTypes_T_UnalignedConstFlat_tensorflow_Tensor_unaligned_flat"></a>
#### `TTypes<T>::ConstMatrix tensorflow::Tensor::flat_inner_dims() const` <a class="md-anchor" id="TTypes_T_ConstMatrix_tensorflow_Tensor_flat_inner_dims"></a>
#### `TTypes<T>::ConstMatrix tensorflow::Tensor::flat_outer_dims() const` <a class="md-anchor" id="TTypes_T_ConstMatrix_tensorflow_Tensor_flat_outer_dims"></a>
#### `TTypes< T, NDIMS >::ConstTensor tensorflow::Tensor::shaped(gtl::ArraySlice< int64 > new_sizes) const` <a class="md-anchor" id="TTypes_T_NDIMS_ConstTensor_tensorflow_Tensor_shaped"></a>
#### `TTypes< T, NDIMS >::UnalignedConstTensor tensorflow::Tensor::unaligned_shaped(gtl::ArraySlice< int64 > new_sizes) const` <a class="md-anchor" id="TTypes_T_NDIMS_UnalignedConstTensor_tensorflow_Tensor_unaligned_shaped"></a>
#### `TTypes< T >::ConstScalar tensorflow::Tensor::scalar() const` <a class="md-anchor" id="TTypes_T_ConstScalar_tensorflow_Tensor_scalar"></a>
#### `string tensorflow::Tensor::SummarizeValue(int64 max_entries) const` <a class="md-anchor" id="string_tensorflow_Tensor_SummarizeValue"></a>
Render the first `max_entries` values in `*this` into a string.
#### `string tensorflow::Tensor::DebugString() const` <a class="md-anchor" id="string_tensorflow_Tensor_DebugString"></a>
A human-readable summary of the tensor suitable for debugging.
#### `void tensorflow::Tensor::FillDescription(TensorDescription *description) const` <a class="md-anchor" id="void_tensorflow_Tensor_FillDescription"></a>
Fill in the `TensorDescription` proto with metadata about the tensor that is useful for monitoring and debugging.
#### `StringPiece tensorflow::Tensor::tensor_data() const` <a class="md-anchor" id="StringPiece_tensorflow_Tensor_tensor_data"></a>
Returns a `StringPiece` mapping the current tensor's buffer.
The returned `StringPiece` may point to memory location on devices that the CPU cannot address directly.
NOTE: The underlying tensor buffer is refcounted, so the lifetime of the contents mapped by the `StringPiece` matches the lifetime of the buffer; callers should arrange to make sure the buffer does not get destroyed while the `StringPiece` is still used.
REQUIRES: `DataTypeCanUseMemcpy( dtype() )`.
================================================
FILE: SOURCE/api_docs/cc/ClassTensorBuffer.md
================================================
# Class `tensorflow::TensorBuffer` <a class="md-anchor" id="AUTOGENERATED-class--tensorflow--tensorbuffer-"></a>
##Member Summary <a class="md-anchor" id="AUTOGENERATED-member-summary"></a>
* [`tensorflow::TensorBuffer::~TensorBuffer() override`](#tensorflow_TensorBuffer_TensorBuffer)
* [`virtual void* tensorflow::TensorBuffer::data() const =0`](#virtual_void_tensorflow_TensorBuffer_data)
* [`virtual size_t tensorflow::TensorBuffer::size() const =0`](#virtual_size_t_tensorflow_TensorBuffer_size)
* [`virtual TensorBuffer* tensorflow::TensorBuffer::root_buffer()=0`](#virtual_TensorBuffer_tensorflow_TensorBuffer_root_buffer)
* [`virtual void tensorflow::TensorBuffer::FillAllocationDescription(AllocationDescription *proto) const =0`](#virtual_void_tensorflow_TensorBuffer_FillAllocationDescription)
* [`T* tensorflow::TensorBuffer::base() const`](#T_tensorflow_TensorBuffer_base)
##Member Details <a class="md-anchor" id="AUTOGENERATED-member-details"></a>
#### `tensorflow::TensorBuffer::~TensorBuffer() override` <a class="md-anchor" id="tensorflow_TensorBuffer_TensorBuffer"></a>
#### `virtual void* tensorflow::TensorBuffer::data() const =0` <a class="md-anchor" id="virtual_void_tensorflow_TensorBuffer_data"></a>
#### `virtual size_t tensorflow::TensorBuffer::size() const =0` <a class="md-anchor" id="virtual_size_t_tensorflow_TensorBuffer_size"></a>
#### `virtual TensorBuffer* tensorflow::TensorBuffer::root_buffer()=0` <a class="md-anchor" id="virtual_TensorBuffer_tensorflow_TensorBuffer_root_buffer"></a>
#### `virtual void tensorflow::TensorBuffer::FillAllocationDescription(AllocationDescription *proto) const =0` <a class="md-anchor" id="virtual_void_tensorflow_TensorBuffer_FillAllocationDescription"></a>
#### `T* tensorflow::TensorBuffer::base() const` <a class="md-anchor" id="T_tensorflow_TensorBuffer_base"></a>
================================================
FILE: SOURCE/api_docs/cc/ClassTensorShape.md
================================================
# Class `tensorflow::TensorShape` <a class="md-anchor" id="AUTOGENERATED-class--tensorflow--tensorshape-"></a>
Manages the dimensions of a Tensor and their sizes.
##Member Summary <a class="md-anchor" id="AUTOGENERATED-member-summary"></a>
* [`tensorflow::TensorShape::TensorShape(gtl::ArraySlice< int64 > dim_sizes)`](#tensorflow_TensorShape_TensorShape)
* Construct a ` TensorShape ` from the provided sizes. REQUIRES: `dim_sizes[i] >= 0`
* [`tensorflow::TensorShape::TensorShape(std::initializer_list< int64 > dim_sizes)`](#tensorflow_TensorShape_TensorShape)
* [`tensorflow::TensorShape::TensorShape(const TensorShapeProto &proto)`](#tensorflow_TensorShape_TensorShape)
* REQUIRES: `IsValid(proto)`
* [`tensorflow::TensorShape::TensorShape()`](#tensorflow_TensorShape_TensorShape)
* [`void tensorflow::TensorShape::Clear()`](#void_tensorflow_TensorShape_Clear)
* Clear a tensor shape.
* [`void tensorflow::TensorShape::AddDim(int64 size)`](#void_tensorflow_TensorShape_AddDim)
* Add a dimension to the end ("inner-most"). REQUIRES: `size >= 0`
* [`void tensorflow::TensorShape::AppendShape(const TensorShape &shape)`](#void_tensorflow_TensorShape_AppendShape)
* Appends all the dimensions from `shape`.
* [`void tensorflow::TensorShape::InsertDim(int d, int64 size)`](#void_tensorflow_TensorShape_InsertDim)
* Insert a dimension somewhere in the ` TensorShape `. REQUIRES: `0 <= d <= dims() ` REQUIRES: `size >= 0`
* [`void tensorflow::TensorShape::set_dim(int d, int64 size)`](#void_tensorflow_TensorShape_set_dim)
* Modifies the size of the dimension `d` to be `size` REQUIRES: `0 <= d < dims() ` REQUIRES: `size >= 0`
* [`void tensorflow::TensorShape::RemoveDim(int d)`](#void_tensorflow_TensorShape_RemoveDim)
* Removes dimension `d` from the ` TensorShape `. REQUIRES: `0 <= d < dims() `
* [`int tensorflow::TensorShape::dims() const`](#int_tensorflow_TensorShape_dims)
* Return the number of dimensions in the tensor.
* [`int64 tensorflow::TensorShape::dim_size(int d) const`](#int64_tensorflow_TensorShape_dim_size)
* Returns the number of elements in dimension `d`. REQUIRES: `0 <= d < dims() `
* [`gtl::ArraySlice<int64> tensorflow::TensorShape::dim_sizes() const`](#gtl_ArraySlice_int64_tensorflow_TensorShape_dim_sizes)
* Returns sizes of all dimensions.
* [`int64 tensorflow::TensorShape::num_elements() const`](#int64_tensorflow_TensorShape_num_elements)
* Returns the number of elements in the tensor.
* [`bool tensorflow::TensorShape::IsSameSize(const TensorShape &b) const`](#bool_tensorflow_TensorShape_IsSameSize)
* [`bool tensorflow::TensorShape::operator==(const TensorShape &b) const`](#bool_tensorflow_TensorShape_operator_)
* [`void tensorflow::TensorShape::AsProto(TensorShapeProto *proto) const`](#void_tensorflow_TensorShape_AsProto)
* Fill `*proto` from `*this`.
* [`Eigen::DSizes< Eigen::DenseIndex, NDIMS > tensorflow::TensorShape::AsEigenDSizes() const`](#Eigen_DSizes_Eigen_DenseIndex_NDIMS_tensorflow_TensorShape_AsEigenDSizes)
* Fill `*dsizes` from `*this`.
* [`Eigen::DSizes< Eigen::DenseIndex, NDIMS > tensorflow::TensorShape::AsEigenDSizesWithPadding() const`](#Eigen_DSizes_Eigen_DenseIndex_NDIMS_tensorflow_TensorShape_AsEigenDSizesWithPadding)
* [`TensorShapeIter tensorflow::TensorShape::begin() const`](#TensorShapeIter_tensorflow_TensorShape_begin)
* For iterating through the dimensions.
* [`TensorShapeIter tensorflow::TensorShape::end() const`](#TensorShapeIter_tensorflow_TensorShape_end)
* [`string tensorflow::TensorShape::DebugString() const`](#string_tensorflow_TensorShape_DebugString)
* For error messages.
* [`string tensorflow::TensorShape::ShortDebugString() const`](#string_tensorflow_TensorShape_ShortDebugString)
* [`static bool tensorflow::TensorShape::IsValid(const TensorShapeProto &proto)`](#static_bool_tensorflow_TensorShape_IsValid)
* Returns `true` iff `proto` is a valid tensor shape.
##Member Details <a class="md-anchor" id="AUTOGENERATED-member-details"></a>
#### `tensorflow::TensorShape::TensorShape(gtl::ArraySlice< int64 > dim_sizes)` <a class="md-anchor" id="tensorflow_TensorShape_TensorShape"></a>
Construct a ` TensorShape ` from the provided sizes. REQUIRES: `dim_sizes[i] >= 0`
#### `tensorflow::TensorShape::TensorShape(std::initializer_list< int64 > dim_sizes)` <a class="md-anchor" id="tensorflow_TensorShape_TensorShape"></a>
#### `tensorflow::TensorShape::TensorShape(const TensorShapeProto &proto)` <a class="md-anchor" id="tensorflow_TensorShape_TensorShape"></a>
REQUIRES: `IsValid(proto)`
#### `tensorflow::TensorShape::TensorShape()` <a class="md-anchor" id="tensorflow_TensorShape_TensorShape"></a>
Create a tensor shape with no dimensions and one element, which you can then call ` AddDim() ` on.
#### `void tensorflow::TensorShape::Clear()` <a class="md-anchor" id="void_tensorflow_TensorShape_Clear"></a>
Clear a tensor shape.
#### `void tensorflow::TensorShape::AddDim(int64 size)` <a class="md-anchor" id="void_tensorflow_TensorShape_AddDim"></a>
Add a dimension to the end ("inner-most"). REQUIRES: `size >= 0`
#### `void tensorflow::TensorShape::AppendShape(const TensorShape &shape)` <a class="md-anchor" id="void_tensorflow_TensorShape_AppendShape"></a>
Appends all the dimensions from `shape`.
#### `void tensorflow::TensorShape::InsertDim(int d, int64 size)` <a class="md-anchor" id="void_tensorflow_TensorShape_InsertDim"></a>
Insert a dimension somewhere in the ` TensorShape `. REQUIRES: `0 <= d <= dims() ` REQUIRES: `size >= 0`
#### `void tensorflow::TensorShape::set_dim(int d, int64 size)` <a class="md-anchor" id="void_tensorflow_TensorShape_set_dim"></a>
Modifies the size of the dimension `d` to be `size` REQUIRES: `0 <= d < dims() ` REQUIRES: `size >= 0`
#### `void tensorflow::TensorShape::RemoveDim(int d)` <a class="md-anchor" id="void_tensorflow_TensorShape_RemoveDim"></a>
Removes dimension `d` from the ` TensorShape `. REQUIRES: `0 <= d < dims() `
#### `int tensorflow::TensorShape::dims() const` <a class="md-anchor" id="int_tensorflow_TensorShape_dims"></a>
Return the number of dimensions in the tensor.
#### `int64 tensorflow::TensorShape::dim_size(int d) const` <a class="md-anchor" id="int64_tensorflow_TensorShape_dim_size"></a>
Returns the number of elements in dimension `d`. REQUIRES: `0 <= d < dims() `
#### `gtl::ArraySlice<int64> tensorflow::TensorShape::dim_sizes() const` <a class="md-anchor" id="gtl_ArraySlice_int64_tensorflow_TensorShape_dim_sizes"></a>
Returns sizes of all dimensions.
#### `int64 tensorflow::TensorShape::num_elements() const` <a class="md-anchor" id="int64_tensorflow_TensorShape_num_elements"></a>
Returns the number of elements in the tensor.
We use `int64` and not `size_t` to be compatible with `Eigen::Tensor` which uses `ptrdiff_t`.
#### `bool tensorflow::TensorShape::IsSameSize(const TensorShape &b) const` <a class="md-anchor" id="bool_tensorflow_TensorShape_IsSameSize"></a>
Returns true if `*this` and `b` have the same sizes. Ignores dimension names.
#### `bool tensorflow::TensorShape::operator==(const TensorShape &b) const` <a class="md-anchor" id="bool_tensorflow_TensorShape_operator_"></a>
#### `void tensorflow::TensorShape::AsProto(TensorShapeProto *proto) const` <a class="md-anchor" id="void_tensorflow_TensorShape_AsProto"></a>
Fill `*proto` from `*this`.
#### `Eigen::DSizes< Eigen::DenseIndex, NDIMS > tensorflow::TensorShape::AsEigenDSizes() const` <a class="md-anchor" id="Eigen_DSizes_Eigen_DenseIndex_NDIMS_tensorflow_TensorShape_AsEigenDSizes"></a>
Fill `*dsizes` from `*this`.
#### `Eigen::DSizes< Eigen::DenseIndex, NDIMS > tensorflow::TensorShape::AsEigenDSizesWithPadding() const` <a class="md-anchor" id="Eigen_DSizes_Eigen_DenseIndex_NDIMS_tensorflow_TensorShape_AsEigenDSizesWithPadding"></a>
Same as ` AsEigenDSizes() ` but allows for `NDIMS > dims() ` in which case we pad the rest of the sizes with 1.
#### `TensorShapeIter tensorflow::TensorShape::begin() const` <a class="md-anchor" id="TensorShapeIter_tensorflow_TensorShape_begin"></a>
For iterating through the dimensions.
#### `TensorShapeIter tensorflow::TensorShape::end() const` <a class="md-anchor" id="TensorShapeIter_tensorflow_TensorShape_end"></a>
#### `string tensorflow::TensorShape::DebugString() const` <a class="md-anchor" id="string_tensorflow_TensorShape_DebugString"></a>
For error messages.
#### `string tensorflow::TensorShape::ShortDebugString() const` <a class="md-anchor" id="string_tensorflow_TensorShape_ShortDebugString"></a>
#### `static bool tensorflow::TensorShape::IsValid(const TensorShapeProto &proto)` <a class="md-anchor" id="static_bool_tensorflow_TensorShape_IsValid"></a>
Returns `true` iff `proto` is a valid tensor shape.
================================================
FILE: SOURCE/api_docs/cc/ClassTensorShapeIter.md
================================================
# Class `tensorflow::TensorShapeIter` <a class="md-anchor" id="AUTOGENERATED-class--tensorflow--tensorshapeiter-"></a>
##Member Summary <a class="md-anchor" id="AUTOGENERATED-member-summary"></a>
* [`tensorflow::TensorShapeIter::TensorShapeIter(const TensorShape *shape, int d)`](#tensorflow_TensorShapeIter_TensorShapeIter)
* [`bool tensorflow::TensorShapeIter::operator==(const TensorShapeIter &rhs)`](#bool_tensorflow_TensorShapeIter_operator_)
* [`bool tensorflow::TensorShapeIter::operator!=(const TensorShapeIter &rhs)`](#bool_tensorflow_TensorShapeIter_operator_)
* [`void tensorflow::TensorShapeIter::operator++()`](#void_tensorflow_TensorShapeIter_operator_)
* [`TensorShapeDim tensorflow::TensorShapeIter::operator*()`](#TensorShapeDim_tensorflow_TensorShapeIter_operator_)
##Member Details <a class="md-anchor" id="AUTOGENERATED-member-details"></a>
#### `tensorflow::TensorShapeIter::TensorShapeIter(const TensorShape *shape, int d)` <a class="md-anchor" id="tensorflow_TensorShapeIter_TensorShapeIter"></a>
#### `bool tensorflow::TensorShapeIter::operator==(const TensorShapeIter &rhs)` <a class="md-anchor" id="bool_tensorflow_TensorShapeIter_operator_"></a>
#### `bool tensorflow::TensorShapeIter::operator!=(const TensorShapeIter &rhs)` <a class="md-anchor" id="bool_tensorflow_TensorShapeIter_operator_"></a>
#### `void tensorflow::TensorShapeIter::operator++()` <a class="md-anchor" id="void_tensorflow_TensorShapeIter_operator_"></a>
#### `TensorShapeDim tensorflow::TensorShapeIter::operator*()` <a class="md-anchor" id="TensorShapeDim_tensorflow_TensorShapeIter_operator_"></a>
================================================
FILE: SOURCE/api_docs/cc/ClassTensorShapeUtils.md
================================================
# Class `tensorflow::TensorShapeUtils` <a class="md-anchor" id="AUTOGENERATED-class--tensorflow--tensorshapeutils-"></a>
Static helper routines for ` TensorShape `. Includes a few common predicates on a tensor shape.
##Member Summary <a class="md-anchor" id="AUTOGENERATED-member-summary"></a>
* [`static bool tensorflow::TensorShapeUtils::IsScalar(const TensorShape &shape)`](#static_bool_tensorflow_TensorShapeUtils_IsScalar)
* [`static bool tensorflow::TensorShapeUtils::IsVector(const TensorShape &shape)`](#static_bool_tensorflow_TensorShapeUtils_IsVector)
* [`static bool tensorflow::TensorShapeUtils::IsLegacyScalar(const TensorShape &shape)`](#static_bool_tensorflow_TensorShapeUtils_IsLegacyScalar)
* [`static bool tensorflow::TensorShapeUtils::IsLegacyVector(const TensorShape &shape)`](#static_bool_tensorflow_TensorShapeUtils_IsLegacyVector)
* [`static bool tensorflow::TensorShapeUtils::IsVectorOrHigher(const TensorShape &shape)`](#static_bool_tensorflow_TensorShapeUtils_IsVectorOrHigher)
* [`static bool tensorflow::TensorShapeUtils::IsMatrix(const TensorShape &shape)`](#static_bool_tensorflow_TensorShapeUtils_IsMatrix)
* [`static bool tensorflow::TensorShapeUtils::IsMatrixOrHigher(const TensorShape &shape)`](#static_bool_tensorflow_TensorShapeUtils_IsMatrixOrHigher)
* [`static TensorShape tensorflow::TensorShapeUtils::MakeShape(const T *dims, int n)`](#static_TensorShape_tensorflow_TensorShapeUtils_MakeShape)
* Returns a ` TensorShape ` whose dimensions are `dims[0]`, `dims[1]`, ..., `dims[n-1]`.
* [`static string tensorflow::TensorShapeUtils::ShapeListString(const gtl::ArraySlice< TensorShape > &shapes)`](#static_string_tensorflow_TensorShapeUtils_ShapeListString)
* [`static bool tensorflow::TensorShapeUtils::StartsWith(const TensorShape &shape0, const TensorShape &shape1)`](#static_bool_tensorflow_TensorShapeUtils_StartsWith)
##Member Details <a class="md-anchor" id="AUTOGENERATED-member-details"></a>
#### `static bool tensorflow::TensorShapeUtils::IsScalar(const TensorShape &shape)` <a class="md-anchor" id="static_bool_tensorflow_TensorShapeUtils_IsScalar"></a>
#### `static bool tensorflow::TensorShapeUtils::IsVector(const TensorShape &shape)` <a class="md-anchor" id="static_bool_tensorflow_TensorShapeUtils_IsVector"></a>
#### `static bool tensorflow::TensorShapeUtils::IsLegacyScalar(const TensorShape &shape)` <a class="md-anchor" id="static_bool_tensorflow_TensorShapeUtils_IsLegacyScalar"></a>
#### `static bool tensorflow::TensorShapeUtils::IsLegacyVector(const TensorShape &shape)` <a class="md-anchor" id="static_bool_tensorflow_TensorShapeUtils_IsLegacyVector"></a>
#### `static bool tensorflow::TensorShapeUtils::IsVectorOrHigher(const TensorShape &shape)` <a class="md-anchor" id="static_bool_tensorflow_TensorShapeUtils_IsVectorOrHigher"></a>
#### `static bool tensorflow::TensorShapeUtils::IsMatrix(const TensorShape &shape)` <a class="md-anchor" id="static_bool_tensorflow_TensorShapeUtils_IsMatrix"></a>
#### `static bool tensorflow::TensorShapeUtils::IsMatrixOrHigher(const TensorShape &shape)` <a class="md-anchor" id="static_bool_tensorflow_TensorShapeUtils_IsMatrixOrHigher"></a>
#### `static TensorShape tensorflow::TensorShapeUtils::MakeShape(const T *dims, int n)` <a class="md-anchor" id="static_TensorShape_tensorflow_TensorShapeUtils_MakeShape"></a>
Returns a ` TensorShape ` whose dimensions are `dims[0]`, `dims[1]`, ..., `dims[n-1]`.
#### `static string tensorflow::TensorShapeUtils::ShapeListString(const gtl::ArraySlice< TensorShape > &shapes)` <a class="md-anchor" id="static_string_tensorflow_TensorShapeUtils_ShapeListString"></a>
#### `static bool tensorflow::TensorShapeUtils::StartsWith(const TensorShape &shape0, const TensorShape &shape1)` <a class="md-anchor" id="static_bool_tensorflow_TensorShapeUtils_StartsWith"></a>
================================================
FILE: SOURCE/api_docs/cc/ClassThread.md
================================================
# Class `tensorflow::Thread` <a class="md-anchor" id="AUTOGENERATED-class--tensorflow--thread-"></a>
##Member Summary <a class="md-anchor" id="AUTOGENERATED-member-summary"></a>
* [`tensorflow::Thread::Thread()`](#tensorflow_Thread_Thread)
* [`virtual tensorflow::Thread::~Thread()`](#virtual_tensorflow_Thread_Thread)
* Blocks until the thread of control stops running.
##Member Details <a class="md-anchor" id="AUTOGENERATED-member-details"></a>
#### `tensorflow::Thread::Thread()` <a class="md-anchor" id="tensorflow_Thread_Thread"></a>
#### `virtual tensorflow::Thread::~Thread()` <a class="md-anchor" id="virtual_tensorflow_Thread_Thread"></a>
Blocks until the thread of control stops running.
================================================
FILE: SOURCE/api_docs/cc/ClassWritableFile.md
================================================
# Class `tensorflow::WritableFile` <a class="md-anchor" id="AUTOGENERATED-class--tensorflow--writablefile-"></a>
A file abstraction for sequential writing.
The implementation must provide buffering since callers may append small fragments at a time to the file.
##Member Summary <a class="md-anchor" id="AUTOGENERATED-member-summary"></a>
* [`tensorflow::WritableFile::WritableFile()`](#tensorflow_WritableFile_WritableFile)
* [`virtual tensorflow::WritableFile::~WritableFile()`](#virtual_tensorflow_WritableFile_WritableFile)
* [`virtual Status tensorflow::WritableFile::Append(const StringPiece &data)=0`](#virtual_Status_tensorflow_WritableFile_Append)
* [`virtual Status tensorflow::WritableFile::Close()=0`](#virtual_Status_tensorflow_WritableFile_Close)
* [`virtual Status tensorflow::WritableFile::Flush()=0`](#virtual_Status_tensorflow_WritableFile_Flush)
* [`virtual Status tensorflow::WritableFile::Sync()=0`](#virtual_Status_tensorflow_WritableFile_Sync)
##Member Details <a class="md-anchor" id="AUTOGENERATED-member-details"></a>
#### `tensorflow::WritableFile::WritableFile()` <a class="md-anchor" id="tensorflow_WritableFile_WritableFile"></a>
#### `virtual tensorflow::WritableFile::~WritableFile()` <a class="md-anchor" id="virtual_tensorflow_WritableFile_WritableFile"></a>
#### `virtual Status tensorflow::WritableFile::Append(const StringPiece &data)=0` <a class="md-anchor" id="virtual_Status_tensorflow_WritableFile_Append"></a>
#### `virtual Status tensorflow::WritableFile::Close()=0` <a class="md-anchor" id="virtual_Status_tensorflow_WritableFile_Close"></a>
#### `virtual Status tensorflow::WritableFile::Flush()=0` <a class="md-anchor" id="virtual_Status_tensorflow_WritableFile_Flush"></a>
#### `virtual Status tensorflow::WritableFile::Sync()=0` <a class="md-anchor" id="virtual_Status_tensorflow_WritableFile_Sync"></a>
================================================
FILE: SOURCE/api_docs/cc/StructSessionOptions.md
================================================
# Struct `tensorflow::SessionOptions` <a class="md-anchor" id="AUTOGENERATED-struct--tensorflow--sessionoptions-"></a>
Configuration information for a Session .
##Member Summary <a class="md-anchor" id="AUTOGENERATED-member-summary"></a>
* [`Env* tensorflow::SessionOptions::env`](#Env_tensorflow_SessionOptions_env)
* The environment to use.
* [`string tensorflow::SessionOptions::target`](#string_tensorflow_SessionOptions_target)
* The TensorFlow runtime to connect to.
* [`ConfigProto tensorflow::SessionOptions::config`](#ConfigProto_tensorflow_SessionOptions_config)
* Configuration options.
* [`tensorflow::SessionOptions::SessionOptions()`](#tensorflow_SessionOptions_SessionOptions)
##Member Details <a class="md-anchor" id="AUTOGENERATED-member-details"></a>
#### `Env* tensorflow::SessionOptions::env` <a class="md-anchor" id="Env_tensorflow_SessionOptions_env"></a>
The environment to use.
#### `string tensorflow::SessionOptions::target` <a class="md-anchor" id="string_tensorflow_SessionOptions_target"></a>
The TensorFlow runtime to connect to.
If 'target' is empty or unspecified, the local TensorFlow runtime implementation will be used. Otherwise, the TensorFlow engine defined by 'target' will be used to perform all computations.
"target" can be either a single entry or a comma separated list of entries. Each entry is a resolvable address of the following format: local ip:port host:port ... other system-specific formats to identify tasks and jobs ...
NOTE: at the moment 'local' maps to an in-process service-based runtime.
Upon creation, a single session affines itself to one of the remote processes, with possible load balancing choices when the "target" resolves to a list of possible processes.
If the session disconnects from the remote process during its lifetime, session calls may fail immediately.
#### `ConfigProto tensorflow::SessionOptions::config` <a class="md-anchor" id="ConfigProto_tensorflow_SessionOptions_config"></a>
Configuration options.
#### `tensorflow::SessionOptions::SessionOptions()` <a class="md-anchor" id="tensorflow_SessionOptions_SessionOptions"></a>
================================================
FILE: SOURCE/api_docs/cc/StructState.md
================================================
# Struct `tensorflow::Status::State` <a class="md-anchor" id="AUTOGENERATED-struct--tensorflow--status--state-"></a>
##Member Summary <a class="md-anchor" id="AUTOGENERATED-member-summary"></a>
* [`tensorflow::error::Code tensorflow::Status::State::code`](#tensorflow_error_Code_tensorflow_Status_State_code)
* [`string tensorflow::Status::State::msg`](#string_tensorflow_Status_State_msg)
##Member Details <a class="md-anchor" id="AUTOGENERATED-member-details"></a>
#### `tensorflow::error::Code tensorflow::Status::State::code` <a class="md-anchor" id="tensorflow_error_Code_tensorflow_Status_State_code"></a>
#### `string tensorflow::Status::State::msg` <a class="md-anchor" id="string_tensorflow_Status_State_msg"></a>
================================================
FILE: SOURCE/api_docs/cc/StructTensorShapeDim.md
================================================
# Struct `tensorflow::TensorShapeDim` <a class="md-anchor" id="AUTOGENERATED-struct--tensorflow--tensorshapedim-"></a>
##Member Summary <a class="md-anchor" id="AUTOGENERATED-member-summary"></a>
* [`int tensorflow::TensorShapeDim::size`](#int_tensorflow_TensorShapeDim_size)
* [`tensorflow::TensorShapeDim::TensorShapeDim(int64 s)`](#tensorflow_TensorShapeDim_TensorShapeDim)
##Member Details <a class="md-anchor" id="AUTOGENERATED-member-details"></a>
#### `int tensorflow::TensorShapeDim::size` <a class="md-anchor" id="int_tensorflow_TensorShapeDim_size"></a>
#### `tensorflow::TensorShapeDim::TensorShapeDim(int64 s)` <a class="md-anchor" id="tensorflow_TensorShapeDim_TensorShapeDim"></a>
================================================
FILE: SOURCE/api_docs/cc/StructThreadOptions.md
================================================
# Struct `tensorflow::ThreadOptions` <a class="md-anchor" id="AUTOGENERATED-struct--tensorflow--threadoptions-"></a>
Options to configure a Thread .
Note that the options are all hints, and the underlying implementation may choose to ignore it.
##Member Summary <a class="md-anchor" id="AUTOGENERATED-member-summary"></a>
* [`size_t tensorflow::ThreadOptions::stack_size`](#size_t_tensorflow_ThreadOptions_stack_size)
* Thread stack size to use (in bytes).
* [`size_t tensorflow::ThreadOptions::guard_size`](#size_t_tensorflow_ThreadOptions_guard_size)
* Guard area size to use near thread stacks to use (in bytes)
##Member Details <a class="md-anchor" id="AUTOGENERATED-member-details"></a>
#### `size_t tensorflow::ThreadOptions::stack_size` <a class="md-anchor" id="size_t_tensorflow_ThreadOptions_stack_size"></a>
Thread stack size to use (in bytes).
#### `size_t tensorflow::ThreadOptions::guard_size` <a class="md-anchor" id="size_t_tensorflow_ThreadOptions_guard_size"></a>
Guard area size to use near thread stacks to use (in bytes)
================================================
FILE: SOURCE/api_docs/cc/index.md
================================================
# TensorFlow C++ Session API reference documentation <a class="md-anchor" id="AUTOGENERATED-tensorflow-c---session-api-reference-documentation"></a>
TensorFlow's public C++ API includes only the API for executing graphs, as of
version 0.5. To control the execution of a graph from C++:
1. Build the computation graph using the [Python API](../../api_docs/python/).
1. Use [tf.train.write_graph()](../../api_docs/python/train.md#write_graph) to
write the graph to a file.
1. Load the graph using the C++ Session API. For example:
```c++
// Reads a model graph definition from disk, and creates a session object you
// can use to run it.
Status LoadGraph(string graph_file_name, Session** session) {
GraphDef graph_def;
TF_RETURN_IF_ERROR(
ReadBinaryProto(Env::Default(), graph_file_name, &graph_def));
TF_RETURN_IF_ERROR(NewSession(SessionOptions(), session));
TF_RETURN_IF_ERROR((*session)->Create(graph_def));
return Status::OK();
}
```
1. Run the graph with a call to `session->Run()`
##Classes <a class="md-anchor" id="AUTOGENERATED-classes"></a>
* [tensorflow::Env](../../api_docs/cc/ClassEnv.md)
* [tensorflow::EnvWrapper](../../api_docs/cc/ClassEnvWrapper.md)
* [tensorflow::RandomAccessFile](../../api_docs/cc/ClassRandomAccessFile.md)
* [tensorflow::Session](../../api_docs/cc/ClassSession.md)
* [tensorflow::Status](../../api_docs/cc/ClassStatus.md)
* [tensorflow::Tensor](../../api_docs/cc/ClassTensor.md)
* [tensorflow::TensorBuffer](../../api_docs/cc/ClassTensorBuffer.md)
* [tensorflow::TensorShape](../../api_docs/cc/ClassTensorShape.md)
* [tensorflow::TensorShapeIter](../../api_docs/cc/ClassTensorShapeIter.md)
* [tensorflow::TensorShapeUtils](../../api_docs/cc/ClassTensorShapeUtils.md)
* [tensorflow::Thread](../../api_docs/cc/ClassThread.md)
* [tensorflow::WritableFile](../../api_docs/cc/ClassWritableFile.md)
##Structs <a class="md-anchor" id="AUTOGENERATED-structs"></a>
* [tensorflow::SessionOptions](../../api_docs/cc/StructSessionOptions.md)
* [tensorflow::Status::State](../../api_docs/cc/StructState.md)
* [tensorflow::TensorShapeDim](../../api_docs/cc/StructTensorShapeDim.md)
* [tensorflow::ThreadOptions](../../api_docs/cc/StructThreadOptions.md)
<div class='sections-order' style="display: none;">
<!--
<!-- ClassEnv.md -->
<!-- ClassEnvWrapper.md -->
<!-- ClassRandomAccessFile.md -->
<!-- ClassSession.md -->
<!-- ClassStatus.md -->
<!-- ClassTensor.md -->
<!-- ClassTensorBuffer.md -->
<!-- ClassTensorShape.md -->
<!-- ClassTensorShapeIter.md -->
<!-- ClassTensorShapeUtils.md -->
<!-- ClassThread.md -->
<!-- ClassWritableFile.md -->
<!-- StructSessionOptions.md -->
<!-- StructState.md -->
<!-- StructTensorShapeDim.md -->
<!-- StructThreadOptions.md -->
-->
</div>
================================================
FILE: SOURCE/api_docs/index.md
================================================
# Overview <a class="md-anchor" id="AUTOGENERATED-overview"></a>
TensorFlow has APIs available in several languages both for constructing and
executing a TensorFlow graph. The Python API is at present the most complete
and the easiest to use, but the C++ API may offer some performance advantages
in graph execution, and supports deployment to small devices such as Android.
Over time, we hope that the TensorFlow community will develop front ends for
languages like Go, Java, JavaScript, Lua R, and perhaps others. With
[SWIG](http://swig.org), it's relatively easy to develop a TensorFlow interface
for your favorite language.
Note: Many practical aspects of usage are covered in the Mechanics tab, and
some additional documentation not specific to any particular language API is
available in the Resources tab.
================================================
FILE: SOURCE/api_docs/python/array_ops.md
================================================
<!-- This file is machine generated: DO NOT EDIT! -->
# Tensor Transformations <a class="md-anchor" id="AUTOGENERATED-tensor-transformations"></a>
Note: Functions taking `Tensor` arguments can also take anything accepted by
[`tf.convert_to_tensor`](../../api_docs/python/framework.md#convert_to_tensor).
<!-- TOC-BEGIN This section is generated by neural network: DO NOT EDIT! -->
## Contents
### [Tensor Transformations](#AUTOGENERATED-tensor-transformations)
* [Casting](#AUTOGENERATED-casting)
* [`tf.string_to_number(string_tensor, out_type=None, name=None)`](#string_to_number)
* [`tf.to_double(x, name='ToDouble')`](#to_double)
* [`tf.to_float(x, name='ToFloat')`](#to_float)
* [`tf.to_bfloat16(x, name='ToBFloat16')`](#to_bfloat16)
* [`tf.to_int32(x, name='ToInt32')`](#to_int32)
* [`tf.to_int64(x, name='ToInt64')`](#to_int64)
* [`tf.cast(x, dtype, name=None)`](#cast)
* [Shapes and Shaping](#AUTOGENERATED-shapes-and-shaping)
* [`tf.shape(input, name=None)`](#shape)
* [`tf.size(input, name=None)`](#size)
* [`tf.rank(input, name=None)`](#rank)
* [`tf.reshape(tensor, shape, name=None)`](#reshape)
* [`tf.squeeze(input, squeeze_dims=None, name=None)`](#squeeze)
* [`tf.expand_dims(input, dim, name=None)`](#expand_dims)
* [Slicing and Joining](#AUTOGENERATED-slicing-and-joining)
* [`tf.slice(input_, begin, size, name=None)`](#slice)
* [`tf.split(split_dim, num_split, value, name='split')`](#split)
* [`tf.tile(input, multiples, name=None)`](#tile)
* [`tf.pad(input, paddings, name=None)`](#pad)
* [`tf.concat(concat_dim, values, name='concat')`](#concat)
* [`tf.pack(values, name='pack')`](#pack)
* [`tf.unpack(value, num=None, name='unpack')`](#unpack)
* [`tf.reverse_sequence(input, seq_lengths, seq_dim, name=None)`](#reverse_sequence)
* [`tf.reverse(tensor, dims, name=None)`](#reverse)
* [`tf.transpose(a, perm=None, name='transpose')`](#transpose)
* [`tf.gather(params, indices, name=None)`](#gather)
* [`tf.dynamic_partition(data, partitions, num_partitions, name=None)`](#dynamic_partition)
* [`tf.dynamic_stitch(indices, data, name=None)`](#dynamic_stitch)
<!-- TOC-END This section was generated by neural network, THANKS FOR READING! -->
## Casting <a class="md-anchor" id="AUTOGENERATED-casting"></a>
TensorFlow provides several operations that you can use to cast tensor data
types in your graph.
- - -
### `tf.string_to_number(string_tensor, out_type=None, name=None)` <a class="md-anchor" id="string_to_number"></a>
Converts each string in the input Tensor to the specified numeric type.
(Note that int32 overflow results in an error while float overflow
results in a rounded value.)
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`string_tensor`</b>: A `Tensor` of type `string`.
* <b>`out_type`</b>: An optional `tf.DType` from: `tf.float32, tf.int32`. Defaults to `tf.float32`.
The numeric type to interpret each string in string_tensor as.
* <b>`name`</b>: A name for the operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
A `Tensor` of type `out_type`.
A Tensor of the same shape as the input string_tensor.
- - -
### `tf.to_double(x, name='ToDouble')` <a class="md-anchor" id="to_double"></a>
Casts a tensor to type `float64`.
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`x`</b>: A `Tensor` or `SparseTensor`.
* <b>`name`</b>: A name for the operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
A `Tensor` or `SparseTensor` with same shape as `x` with type `float64`.
##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
* <b>`TypeError`</b>: If `x` cannot be cast to the `float64`.
- - -
### `tf.to_float(x, name='ToFloat')` <a class="md-anchor" id="to_float"></a>
Casts a tensor to type `float32`.
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`x`</b>: A `Tensor` or `SparseTensor`.
* <b>`name`</b>: A name for the operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
A `Tensor` or `SparseTensor` with same shape as `x` with type `float32`.
##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
* <b>`TypeError`</b>: If `x` cannot be cast to the `float32`.
- - -
### `tf.to_bfloat16(x, name='ToBFloat16')` <a class="md-anchor" id="to_bfloat16"></a>
Casts a tensor to type `bfloat16`.
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`x`</b>: A `Tensor` or `SparseTensor`.
* <b>`name`</b>: A name for the operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
A `Tensor` or `SparseTensor` with same shape as `x` with type `bfloat16`.
##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
* <b>`TypeError`</b>: If `x` cannot be cast to the `bfloat16`.
- - -
### `tf.to_int32(x, name='ToInt32')` <a class="md-anchor" id="to_int32"></a>
Casts a tensor to type `int32`.
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`x`</b>: A `Tensor` or `SparseTensor`.
* <b>`name`</b>: A name for the operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
A `Tensor` or `SparseTensor` with same shape as `x` with type `int32`.
##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
* <b>`TypeError`</b>: If `x` cannot be cast to the `int32`.
- - -
### `tf.to_int64(x, name='ToInt64')` <a class="md-anchor" id="to_int64"></a>
Casts a tensor to type `int64`.
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`x`</b>: A `Tensor` or `SparseTensor`.
* <b>`name`</b>: A name for the operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
A `Tensor` or `SparseTensor` with same shape as `x` with type `int64`.
##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
* <b>`TypeError`</b>: If `x` cannot be cast to the `int64`.
- - -
### `tf.cast(x, dtype, name=None)` <a class="md-anchor" id="cast"></a>
Casts a tensor to a new type.
The operation casts `x` (in case of `Tensor`) or `x.values`
(in case of `SparseTensor`) to `dtype`.
For example:
```python
# tensor `a` is [1.8, 2.2], dtype=tf.float
tf.cast(a, tf.int32) ==> [1, 2] # dtype=tf.int32
```
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`x`</b>: A `Tensor` or `SparseTensor`.
* <b>`dtype`</b>: The destination type.
* <b>`name`</b>: A name for the operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
A `Tensor` or `SparseTensor` with same shape as `x`.
##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
* <b>`TypeError`</b>: If `x` cannot be cast to the `dtype`.
## Shapes and Shaping <a class="md-anchor" id="AUTOGENERATED-shapes-and-shaping"></a>
TensorFlow provides several operations that you can use to determine the shape
of a tensor and change the shape of a tensor.
- - -
### `tf.shape(input, name=None)` <a class="md-anchor" id="shape"></a>
Returns the shape of a tensor.
This operation returns a 1-D integer tensor representing the shape of `input`.
For example:
```prettyprint
# 't' is [[[1, 1, 1], [2, 2, 2]], [[3, 3, 3], [4, 4, 4]]]
shape(t) ==> [2, 2, 3]
```
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`input`</b>: A `Tensor`.
* <b>`name`</b>: A name for the operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
A `Tensor` of type `int32`.
- - -
### `tf.size(input, name=None)` <a class="md-anchor" id="size"></a>
Returns the size of a tensor.
This operation returns an integer representing the number of elements in
`input`.
For example:
```prettyprint
# 't' is [[[1, 1,, 1], [2, 2, 2]], [[3, 3, 3], [4, 4, 4]]]]
size(t) ==> 12
```
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`input`</b>: A `Tensor`.
* <b>`name`</b>: A name for the operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
A `Tensor` of type `int32`.
- - -
### `tf.rank(input, name=None)` <a class="md-anchor" id="rank"></a>
Returns the rank of a tensor.
This operation returns an integer representing the rank of `input`.
For example:
```prettyprint
# 't' is [[[1, 1, 1], [2, 2, 2]], [[3, 3, 3], [4, 4, 4]]]
# shape of tensor 't' is [2, 2, 3]
rank(t) ==> 3
```
**Note**: The rank of a tensor is not the same as the rank of a matrix. The rank
of a tensor is the number of indices required to uniquely select each element
of the tensor. Rank is also known as "order", "degree", or "ndims."
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`input`</b>: A `Tensor`.
* <b>`name`</b>: A name for the operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
A `Tensor` of type `int32`.
- - -
### `tf.reshape(tensor, shape, name=None)` <a class="md-anchor" id="reshape"></a>
Reshapes a tensor.
Given `tensor`, this operation returns a tensor that has the same values
as `tensor` with shape `shape`.
If `shape` is the special value `[-1]`, then `tensor` is flattened and the
operation outputs a 1-D tensor with all elements of `tensor`.
If `shape` is 1-D or higher, then the operation returns a tensor with shape
`shape` filled with the values of `tensor`. In this case, the number of elements
implied by `shape` must be the same as the number of elements in `tensor`.
For example:
```prettyprint
# tensor 't' is [1, 2, 3, 4, 5, 6, 7, 8, 9]
# tensor 't' has shape [9]
reshape(t, [3, 3]) ==> [[1, 2, 3]
[4, 5, 6]
[7, 8, 9]]
# tensor 't' is [[[1, 1], [2, 2]]
# [[3, 3], [4, 4]]]
# tensor 't' has shape [2, 2]
reshape(t, [2, 4]) ==> [[1, 1, 2, 2]
[3, 3, 4, 4]]
# tensor 't' is [[[1, 1, 1],
# [2, 2, 2]],
# [[3, 3, 3],
# [4, 4, 4]],
# [[5, 5, 5],
# [6, 6, 6]]]
# tensor 't' has shape [3, 2, 3]
# pass '[-1]' to flatten 't'
reshape(t, [-1]) ==> [1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6]
```
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`tensor`</b>: A `Tensor`.
* <b>`shape`</b>: A `Tensor` of type `int32`. Defines the shape of the output tensor.
* <b>`name`</b>: A name for the operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
A `Tensor`. Has the same type as `tensor`.
- - -
### `tf.squeeze(input, squeeze_dims=None, name=None)` <a class="md-anchor" id="squeeze"></a>
Removes dimensions of size 1 from the shape of a tensor.
Given a tensor `input`, this operation returns a tensor of the same type with
all dimensions of size 1 removed. If you don't want to remove all size 1
dimensions, you can remove specific size 1 dimensions by specifying
`squeeze_dims`.
For example:
```prettyprint
# 't' is a tensor of shape [1, 2, 1, 3, 1, 1]
shape(squeeze(t)) ==> [2, 3]
```
Or, to remove specific size 1 dimensions:
```prettyprint
# 't' is a tensor of shape [1, 2, 1, 3, 1, 1]
shape(squeeze(t, [2, 4])) ==> [1, 2, 3, 1]
```
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`input`</b>: A `Tensor`. The `input` to squeeze.
* <b>`squeeze_dims`</b>: An optional list of `ints`. Defaults to `[]`.
If specified, only squeezes the dimensions listed. The dimension
index starts at 0. It is an error to squeeze a dimension that is not 1.
* <b>`name`</b>: A name for the operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
A `Tensor`. Has the same type as `input`.
Contains the same data as `input`, but has one or more dimensions of
size 1 removed.
- - -
### `tf.expand_dims(input, dim, name=None)` <a class="md-anchor" id="expand_dims"></a>
Inserts a dimension of 1 into a tensor's shape.
Given a tensor `input`, this operation inserts a dimension of 1 at the
dimension index `dim` of `input`'s shape. The dimension index `dim` starts at
zero; if you specify a negative number for `dim` it is counted backward from
the end.
This operation is useful if you want to add a batch dimension to a single
element. For example, if you have a single image of shape `[height, width,
channels]`, you can make it a batch of 1 image with `expand_dims(image, 0)`,
which will make the shape `[1, height, width, channels]`.
Other examples:
```prettyprint
# 't' is a tensor of shape [2]
shape(expand_dims(t, 0)) ==> [1, 2]
shape(expand_dims(t, 1)) ==> [2, 1]
shape(expand_dims(t, -1)) ==> [2, 1]
# 't2' is a tensor of shape [2, 3, 5]
shape(expand_dims(t2, 0)) ==> [1, 2, 3, 5]
shape(expand_dims(t2, 2)) ==> [2, 3, 1, 5]
shape(expand_dims(t2, 3)) ==> [2, 3, 5, 1]
```
This operation requires that:
`-1-input.dims() <= dim <= input.dims()`
This operation is related to `squeeze()`, which removes dimensions of
size 1.
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`input`</b>: A `Tensor`.
* <b>`dim`</b>: A `Tensor` of type `int32`.
0-D (scalar). Specifies the dimension index at which to
expand the shape of `input`.
* <b>`name`</b>: A name for the operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
A `Tensor`. Has the same type as `input`.
Contains the same data as `input`, but its shape has an additional
dimension of size 1 added.
## Slicing and Joining <a class="md-anchor" id="AUTOGENERATED-slicing-and-joining"></a>
TensorFlow provides several operations to slice or extract parts of a tensor,
or join multiple tensors together.
- - -
### `tf.slice(input_, begin, size, name=None)` <a class="md-anchor" id="slice"></a>
Extracts a slice from a tensor.
This operation extracts a slice of size `size` from a tensor `input` starting
at the location specified by `begin`. The slice `size` is represented as a
tensor shape, where `size[i]` is the number of elements of the 'i'th dimension
of `input` that you want to slice. The starting location (`begin`) for the
slice is represented as an offset in each dimension of `input`. In other
words, `begin[i]` is the offset into the 'i'th dimension of `input` that you
want to slice from.
`begin` is zero-based; `size` is one-based. If `size[i]` is -1,
all remaining elements in dimension i are included in the
slice. In other words, this is equivalent to setting:
`size[i] = input.dim_size(i) - begin[i]`
This operation requires that:
`0 <= begin[i] <= begin[i] + size[i] <= Di for i in [0, n]`
For example:
```
# 'input' is [[[1, 1, 1], [2, 2, 2]],
# [[3, 3, 3], [4, 4, 4]],
# [[5, 5, 5], [6, 6, 6]]]
tf.slice(input, [1, 0, 0], [1, 1, 3]) ==> [[[3, 3, 3]]]
tf.slice(input, [1, 0, 0], [1, 2, 3]) ==> [[[3, 3, 3],
[4, 4, 4]]]
tf.slice(input, [1, 0, 0], [2, 1, 3]) ==> [[[3, 3, 3]],
[[5, 5, 5]]]
```
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`input_`</b>: A `Tensor`.
* <b>`begin`</b>: An `int32` or `int64` `Tensor`.
* <b>`size`</b>: An `int32` or `int64` `Tensor`.
* <b>`name`</b>: A name for the operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
A `Tensor` the same type as `input`.
- - -
### `tf.split(split_dim, num_split, value, name='split')` <a class="md-anchor" id="split"></a>
Splits a tensor into `num_split` tensors along one dimension.
Splits `value` along dimension `split_dim` into `num_split` smaller tensors.
Requires that `num_split` evenly divide `value.shape[split_dim]`.
For example:
```python
# 'value' is a tensor with shape [5, 30]
# Split 'value' into 3 tensors along dimension 1
split0, split1, split2 = tf.split(1, 3, value)
tf.shape(split0) ==> [5, 10]
```
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`split_dim`</b>: A 0-D `int32` `Tensor`. The dimension along which to split.
Must be in the range `[0, rank(value))`.
* <b>`num_split`</b>: A 0-D `int32` `Tensor`. The number of ways to split.
* <b>`value`</b>: The `Tensor` to split.
* <b>`name`</b>: A name for the operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
`num_split` `Tensor` objects resulting from splitting `value`.
- - -
### `tf.tile(input, multiples, name=None)` <a class="md-anchor" id="tile"></a>
Constructs a tensor by tiling a given tensor.
This operation creates a new tensor by replicating `input` `multiples` times.
The output tensor's i'th dimension has `input.dims(i) * multiples[i]` elements,
and the values of `input` are replicated `multiples[i]` times along the 'i'th
dimension. For example, tiling `[a b c d]` by `[2]` produces
`[a b c d a b c d]`.
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`input`</b>: A `Tensor`. 1-D or higher.
* <b>`multiples`</b>: A `Tensor` of type `int32`.
1-D. Length must be the same as the number of dimensions in `input`
* <b>`name`</b>: A name for the operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
A `Tensor`. Has the same type as `input`.
- - -
### `tf.pad(input, paddings, name=None)` <a class="md-anchor" id="pad"></a>
Pads a tensor with zeros.
This operation pads a `input` with zeros according to the `paddings` you
specify. `paddings` is an integer tensor with shape `[Dn, 2]`, where n is the
rank of `input`. For each dimension D of `input`, `paddings[D, 0]` indicates
how many zeros to add before the contents of `input` in that dimension, and
`paddings[D, 1]` indicates how many zeros to add after the contents of `input`
in that dimension.
The padded size of each dimension D of the output is:
`paddings(D, 0) + input.dim_size(D) + paddings(D, 1)`
For example:
```prettyprint
# 't' is [[1, 1], [2, 2]]
# 'paddings' is [[1, 1]], [2, 2]]
# rank of 't' is 2
pad(t, paddings) ==> [[0, 0, 0, 0, 0]
[0, 0, 0, 0, 0]
[0, 1, 1, 0, 0]
[[0, 2, 2, 0, 0]
[0, 0, 0, 0, 0]]
```
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`input`</b>: A `Tensor`.
* <b>`paddings`</b>: A `Tensor` of type `int32`.
* <b>`name`</b>: A name for the operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
A `Tensor`. Has the same type as `input`.
- - -
### `tf.concat(concat_dim, values, name='concat')` <a class="md-anchor" id="concat"></a>
Concatenates tensors along one dimension.
Concatenates the list of tensors `values` along dimension `concat_dim`. If
`values[i].shape = [D0, D1, ... Dconcat_dim(i), ...Dn]`, the concatenated
result has shape
[D0, D1, ... Rconcat_dim, ...Dn]
where
Rconcat_dim = sum(Dconcat_dim(i))
That is, the data from the input tensors is joined along the `concat_dim`
dimension.
The number of dimensions of the input tensors must match, and all dimensions
except `concat_dim` must be equal.
For example:
```python
t1 = [[1, 2, 3], [4, 5, 6]]
t2 = [[7, 8, 9], [10, 11, 12]]
tf.concat(0, [t1, t2]) ==> [[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]]
tf.concat(1, [t1, t2]) ==> [[1, 2, 3, 7, 8, 9], [4, 5, 6, 10, 11, 12]]
# tensor t3 with shape [2, 3]
# tensor t4 with shape [2, 3]
tf.shape(tf.concat(0, [t3, t4])) ==> [4, 3]
tf.shape(tf.concat(1, [t3, t4])) ==> [2, 6]
```
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`concat_dim`</b>: 0-D `int32` `Tensor`. Dimension along which to concatenate.
* <b>`values`</b>: A list of `Tensor` objects or a single `Tensor`.
* <b>`name`</b>: A name for the operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
A `Tensor` resulting from concatenation of the input tensors.
- - -
### `tf.pack(values, name='pack')` <a class="md-anchor" id="pack"></a>
Packs a list of rank-`R` tensors into one rank-`(R+1)` tensor.
Packs tensors in `values` into a tensor with rank one higher than each tensor
in `values` and shape `[len(values)] + values[0].shape`. The output satisfies
`output[i, ...] = values[i][...]`.
This is the opposite of unpack. The numpy equivalent is
tf.pack([x, y, z]) = np.asarray([x, y, z])
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`values`</b>: A list of `Tensor` objects with the same shape and type.
* <b>`name`</b>: A name for this operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
* <b>`output`</b>: A packed `Tensor` with the same type as `values`.
- - -
### `tf.unpack(value, num=None, name='unpack')` <a class="md-anchor" id="unpack"></a>
Unpacks the outer dimension of a rank-`R` tensor into rank-`(R-1)` tensors.
Unpacks `num` tensors from `value` along the first dimension.
If `num` is not specified (the default), it is inferred from `value`'s shape.
If `value.shape[0]` is not known, `ValueError` is raised.
The ith tensor in `output` is the slice `value[i, ...]`. Each tensor in
`output` has shape `value.shape[1:]`.
This is the opposite of pack. The numpy equivalent is
tf.unpack(x, n) = list(x)
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`value`</b>: A rank `R > 0` `Tensor` to be unpacked.
* <b>`num`</b>: An `int`. The first dimension of value. Automatically inferred if
`None` (the default).
* <b>`name`</b>: A name for the operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
The list of `Tensor` objects unpacked from `value`.
##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
* <b>`ValueError`</b>: If `num` is unspecified and cannot be inferred.
- - -
### `tf.reverse_sequence(input, seq_lengths, seq_dim, name=None)` <a class="md-anchor" id="reverse_sequence"></a>
Reverses variable length slices in dimension `seq_dim`.
This op first slices `input` along the first dimension, and for each slice `i`,
reverses the first `seq_lengths[i]` elements along the dimension `seq_dim`.
The elements of `seq_lengths` must obey `seq_lengths[i] < input.dims[seq_dim]`,
and `seq_lengths` must be a vector of length `input.dims(0)`.
The output slice `i` along dimension 0 is then given by input slice `i`, with
the first `seq_lengths[i]` slices along dimension `seq_dim` reversed.
For example:
```prettyprint
# Given this:
seq_dim = 1
input.dims = (4, ...)
seq_lengths = [7, 2, 3, 5]
# then slices of input are reversed on seq_dim, but only up to seq_lengths:
output[0, 0:7, :, ...] = input[0, 7:0:-1, :, ...]
output[1, 0:2, :, ...] = input[1, 2:0:-1, :, ...]
output[2, 0:3, :, ...] = input[2, 3:0:-1, :, ...]
output[3, 0:5, :, ...] = input[3, 5:0:-1, :, ...]
# while entries past seq_lens are copied through:
output[0, 7:, :, ...] = input[0, 7:, :, ...]
output[1, 2:, :, ...] = input[1, 2:, :, ...]
output[2, 3:, :, ...] = input[2, 3:, :, ...]
output[3, 2:, :, ...] = input[3, 2:, :, ...]
```
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`input`</b>: A `Tensor`. The input to reverse.
* <b>`seq_lengths`</b>: A `Tensor` of type `int64`.
1-D with length `input.dims(0)` and
`max(seq_lengths) < input.dims(seq_dim)`
* <b>`seq_dim`</b>: An `int`. The dimension which is partially reversed.
* <b>`name`</b>: A name for the operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
A `Tensor`. Has the same type as `input`.
The partially reversed input. It has the same shape as `input`.
- - -
### `tf.reverse(tensor, dims, name=None)` <a class="md-anchor" id="reverse"></a>
Reverses specific dimensions of a tensor.
Given a `tensor`, and a `bool` tensor `dims` representing the dimensions
of `tensor`, this operation reverses each dimension i of `tensor` where
`dims[i]` is `True`.
`tensor` can have up to 8 dimensions. The number of dimensions
of `tensor` must equal the number of elements in `dims`. In other words:
`rank(tensor) = size(dims)`
For example:
```prettyprint
# tensor 't' is [[[[ 0, 1, 2, 3],
# [ 4, 5, 6, 7],
# [ 8, 9, 10, 11]],
# [[12, 13, 14, 15],
# [16, 17, 18, 19],
# [20, 21, 22, 23]]]]
# tensor 't' shape is [1, 2, 3, 4]
# 'dims' is [False, False, False, True]
reverse(t, dims) ==> [[[[ 3, 2, 1, 0],
[ 7, 6, 5, 4],
[ 11, 10, 9, 8]],
[[15, 14, 13, 12],
[19, 18, 17, 16],
[23, 22, 21, 20]]]]
# 'dims' is [False, True, False, False]
reverse(t, dims) ==> [[[[12, 13, 14, 15],
[16, 17, 18, 19],
[20, 21, 22, 23]
[[ 0, 1, 2, 3],
[ 4, 5, 6, 7],
[ 8, 9, 10, 11]]]]
# 'dims' is [False, False, True, False]
reverse(t, dims) ==> [[[[8, 9, 10, 11],
[4, 5, 6, 7],
[0, 1, 2, 3]]
[[20, 21, 22, 23],
[16, 17, 18, 19],
[12, 13, 14, 15]]]]
```
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`tensor`</b>: A `Tensor`. Must be one of the following types: `uint8`, `int8`, `int32`, `bool`, `float32`, `float64`.
Up to 8-D.
* <b>`dims`</b>: A `Tensor` of type `bool`. 1-D. The dimensions to reverse.
* <b>`name`</b>: A name for the operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
A `Tensor`. Has the same type as `tensor`. The same shape as `tensor`.
- - -
### `tf.transpose(a, perm=None, name='transpose')` <a class="md-anchor" id="transpose"></a>
Transposes `a`. Permutes the dimensions according to `perm`.
The returned tensor's dimension i will correspond to the input dimension
`perm[i]`. If `perm` is not given, it is set to (n-1...0), where n is
the rank of the input tensor. Hence by default, this operation performs a
regular matrix transpose on 2-D input Tensors.
For example:
```python
# 'x' is [[1 2 3]
# [4 5 6]]
tf.transpose(x) ==> [[1 4]
[2 5]
[3 6]]
# Equivalently
tf.transpose(x perm=[0, 1]) ==> [[1 4]
[2 5]
[3 6]]
# 'perm' is more useful for n-dimensional tensors, for n > 2
# 'x' is [[[1 2 3]
# [4 5 6]]
# [[7 8 9]
# [10 11 12]]]
# Take the transpose of the matrices in dimension-0
tf.transpose(b, perm=[0, 2, 1]) ==> [[[1 4]
[2 5]
[3 6]]
[[7 10]
[8 11]
[9 12]]]
```
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`a`</b>: A `Tensor`.
* <b>`perm`</b>: A permutation of the dimensions of `a`.
* <b>`name`</b>: A name for the operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
A transposed `Tensor`.
- - -
### `tf.gather(params, indices, name=None)` <a class="md-anchor" id="gather"></a>
Gather slices from `params` according to `indices`.
`indices` must be an integer tensor of any dimension (usually 0-D or 1-D).
Produces an output tensor with shape `indices.shape + params.shape[1:]` where:
# Scalar indices
output[:, ..., :] = params[indices, :, ... :]
# Vector indices
output[i, :, ..., :] = params[indices[i], :, ... :]
# Higher rank indices
output[i, ..., j, :, ... :] = params[indices[i, ..., j], :, ..., :]
If `indices` is a permutation and `len(indices) == params.shape[0]` then
this operation will permute `params` accordingly.
<div style="width:70%; margin:auto; margin-bottom:10px; margin-top:20px;">
<img style="width:100%" src="../images/Gather.png" alt>
</div>
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`params`</b>: A `Tensor`.
* <b>`indices`</b>: A `Tensor`. Must be one of the following types: `int32`, `int64`.
* <b>`name`</b>: A name for the operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
A `Tensor`. Has the same type as `params`.
- - -
### `tf.dynamic_partition(data, partitions, num_partitions, name=None)` <a class="md-anchor" id="dynamic_partition"></a>
Partitions `data` into `num_partitions` tensors using indices from `partitions`.
For each index tuple `js` of size `partitions.ndim`, the slice `data[js, ...]`
becomes part of `outputs[partitions[js]]`. The slices with `partitions[js] = i`
are placed in `outputs[i]` in lexicographic order of `js`, and the first
dimension of `outputs[i]` is the number of entries in `partitions` equal to `i`.
In detail,
outputs[i].shape = [sum(partitions == i)] + data.shape[partitions.ndim:]
outputs[i] = pack([data[js, ...] for js if partitions[js] == i])
`data.shape` must start with `partitions.shape`.
For example:
# Scalar partitions
partitions = 1
num_partitions = 2
data = [10, 20]
outputs[0] = [] # Empty with shape [0, 2]
outputs[1] = [[10, 20]]
# Vector partitions
partitions = [0, 0, 1, 1, 0]
num_partitions = 2
data = [10, 20, 30, 40, 50]
outputs[0] = [10, 20, 50]
outputs[1] = [30, 40]
<div style="width:70%; margin:auto; margin-bottom:10px; margin-top:20px;">
<img style="width:100%" src="../images/DynamicPartition.png" alt>
</div>
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`data`</b>: A `Tensor`.
* <b>`partitions`</b>: A `Tensor` of type `int32`.
Any shape. Indices in the range `[0, num_partitions)`.
* <b>`num_partitions`</b>: An `int` that is `>= 1`.
The number of partitions to output.
* <b>`name`</b>: A name for the operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
A list of `num_partitions` `Tensor` objects of the same type as data.
- - -
### `tf.dynamic_stitch(indices, data, name=None)` <a class="md-anchor" id="dynamic_stitch"></a>
Interleave the values from the `data` tensors into a single tensor.
Builds a merged tensor such that
merged[indices[m][i, ..., j], ...] = data[m][i, ..., j, ...]
For example, if each `indices[m]` is scalar or vector, we have
# Scalar indices
merged[indices[m], ...] = data[m][...]
# Vector indices
merged[indices[m][i], ...] = data[m][i, ...]
Each `data[i].shape` must start with the corresponding `indices[i].shape`,
and the rest of `data[i].shape` must be constant w.r.t. `i`. That is, we
must have `data[i].shape = indices[i].shape + constant`. In terms of this
`constant`, the output shape is
merged.shape = [max(indices)] + constant
Values are merged in order, so if an index appears in both `indices[m][i]` and
`indices[n][j]` for `(m,i) < (n,j)` the slice `data[n][j]` will appear in the
merged result.
For example:
indices[0] = 6
indices[1] = [4, 1]
indices[2] = [[5, 2], [0, 3]]
data[0] = [61, 62]
data[1] = [[41, 42], [11, 12]]
data[2] = [[[51, 52], [21, 22]], [[1, 2], [31, 32]]]
merged = [[1, 2], [11, 12], [21, 22], [31, 32], [41, 42],
[51, 52], [61, 62]]
<div style="width:70%; margin:auto; margin-bottom:10px; margin-top:20px;">
<img style="width:100%" src="../images/DynamicStitch.png" alt>
</div>
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`indices`</b>: A list of at least 2 `Tensor` objects of type `int32`.
* <b>`data`</b>: A list with the same number of `Tensor` objects as `indices` of `Tensor` objects of the same type.
* <b>`name`</b>: A name for the operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
A `Tensor`. Has the same type as `data`.
================================================
FILE: SOURCE/api_docs/python/client.md
================================================
<!-- This file is machine generated: DO NOT EDIT! -->
# Running Graphs <a class="md-anchor" id="AUTOGENERATED-running-graphs"></a>
<!-- TOC-BEGIN This section is generated by neural network: DO NOT EDIT! -->
## Contents
### [Running Graphs](#AUTOGENERATED-running-graphs)
* [Session management](#AUTOGENERATED-session-management)
* [`class tf.Session`](#Session)
* [`class tf.InteractiveSession`](#InteractiveSession)
* [`tf.get_default_session()`](#get_default_session)
* [Error classes](#AUTOGENERATED-error-classes)
* [`class tf.OpError`](#OpError)
* [`class tf.errors.CancelledError`](#CancelledError)
* [`class tf.errors.UnknownError`](#UnknownError)
* [`class tf.errors.InvalidArgumentError`](#InvalidArgumentError)
* [`class tf.errors.DeadlineExceededError`](#DeadlineExceededError)
* [`class tf.errors.NotFoundError`](#NotFoundError)
* [`class tf.errors.AlreadyExistsError`](#AlreadyExistsError)
* [`class tf.errors.PermissionDeniedError`](#PermissionDeniedError)
* [`class tf.errors.UnauthenticatedError`](#UnauthenticatedError)
* [`class tf.errors.ResourceExhaustedError`](#ResourceExhaustedError)
* [`class tf.errors.FailedPreconditionError`](#FailedPreconditionError)
* [`class tf.errors.AbortedError`](#AbortedError)
* [`class tf.errors.OutOfRangeError`](#OutOfRangeError)
* [`class tf.errors.UnimplementedError`](#UnimplementedError)
* [`class tf.errors.InternalError`](#InternalError)
* [`class tf.errors.UnavailableError`](#UnavailableError)
* [`class tf.errors.DataLossError`](#DataLossError)
<!-- TOC-END This section was generated by neural network, THANKS FOR READING! -->
This library contains classes for launching graphs and executing operations.
The [basic usage](../../get_started/introduction.md#basic-usage) guide has
examples of how a graph is launched in a [`tf.Session`](#Session).
## Session management <a class="md-anchor" id="AUTOGENERATED-session-management"></a>
- - -
### `class tf.Session` <a class="md-anchor" id="Session"></a>
A class for running TensorFlow operations.
A `Session` object encapsulates the environment in which `Operation`
objects are executed, and `Tensor` objects are evaluated. For
example:
```python
# Build a graph.
a = tf.constant(5.0)
b = tf.constant(6.0)
c = a * b
# Launch the graph in a session.
sess = tf.Session()
# Evaluate the tensor `c`.
print sess.run(c)
```
A session may own resources, such as
[variables](../../api_docs/python/state_ops.md#Variable), [queues](../../api_docs/python/io_ops.md#QueueBase),
and [readers](../../api_docs/python/io_ops.md#ReaderBase). It is important to release
these resources when they are no longer required. To do this, either
invoke the [`close()`](#Session.close) method on the session, or use
the session as a context manager. The following two examples are
equivalent:
```python
# Using the `close()` method.
sess = tf.Session()
sess.run(...)
sess.close()
# Using the context manager.
with tf.Session() as sess:
sess.run(...)
```
The [`ConfigProto`]
(https://tensorflow.googlesource.com/tensorflow/+/master/tensorflow/core/framework/config.proto)
protocol buffer exposes various configuration options for a
session. For example, to create a session that uses soft constraints
for device placement, and log the resulting placement decisions,
create a session as follows:
```python
# Launch the graph in a session that allows soft device placement and
# logs the placement decisions.
sess = tf.Session(config=tf.ConfigProto(allow_soft_placement=True,
log_device_placement=True))
```
- - -
#### `tf.Session.__init__(target='', graph=None, config=None)` <a class="md-anchor" id="Session.__init__"></a>
Creates a new TensorFlow session.
If no `graph` argument is specified when constructing the session,
the default graph will be launched in the session. If you are
using more than one graph (created with `tf.Graph()` in the same
process, you will have to use different sessions for each graph,
but each graph can be used in multiple sessions. In this case, it
is often clearer to pass the graph to be launched explicitly to
the session constructor.
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`target`</b>: (Optional.) The execution engine to connect to.
Defaults to using an in-process engine. At present, no value
other than the empty string is supported.
* <b>`graph`</b>: (Optional.) The `Graph` to be launched (described above).
* <b>`config`</b>: (Optional.) A [`ConfigProto`](https://tensorflow.googlesource.com/tensorflow/+/master/tensorflow/core/framework/config.proto)
protocol buffer with configuration options for the session.
- - -
#### `tf.Session.run(fetches, feed_dict=None)` <a class="md-anchor" id="Session.run"></a>
Runs the operations and evaluates the tensors in `fetches`.
This method runs one "step" of TensorFlow computation, by
running the necessary graph fragment to execute every `Operation`
and evaluate every `Tensor` in `fetches`, substituting the values in
`feed_dict` for the corresponding input values.
The `fetches` argument may be a list of graph elements or a single
graph element, and these determine the return value of this
method. A graph element can be one of the following types:
* If the *i*th element of `fetches` is an
[`Operation`](../../api_docs/python/framework.md#Operation), the *i*th
return value will be `None`.
* If the *i*th element of `fetches` is a
[`Tensor`](../../api_docs/python/framework.md#Tensor), the *i*th return
value will be a numpy ndarray containing the value of that tensor.
* If the *i*th element of `fetches` is a
[`SparseTensor`](../../api_docs/python/sparse_ops.md#SparseTensor),
the *i*th return value will be a
[`SparseTensorValue`](../../api_docs/python/sparse_ops.md#SparseTensorValue)
containing the value of that sparse tensor.
The optional `feed_dict` argument allows the caller to override
the value of tensors in the graph. Each key in `feed_dict` can be
one of the following types:
* If the key is a [`Tensor`](../../api_docs/python/framework.md#Tensor), the
value may be a Python scalar, string, list, or numpy ndarray
that can be converted to the same `dtype` as that
tensor. Additionally, if the key is a
[placeholder](../../api_docs/python/io_ops.md#placeholder), the shape of
the value will be checked for compatibility with the placeholder.
* If the key is a
[`SparseTensor`](../../api_docs/python/sparse_ops.md#SparseTensor),
the value should be a
[`SparseTensorValue`](../../api_docs/python/sparse_ops.md#SparseTensorValue).
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`fetches`</b>: A single graph element, or a list of graph elements
(described above).
* <b>`feed_dict`</b>: A dictionary that maps graph elements to values
(described above).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
Either a single value if `fetches` is a single graph element, or
a list of values if `fetches` is a list (described above).
##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
* <b>`RuntimeError`</b>: If this `Session` is in an invalid state (e.g. has been
closed).
* <b>`TypeError`</b>: If `fetches` or `feed_dict` keys are of an inappropriate type.
* <b>`ValueError`</b>: If `fetches` or `feed_dict` keys are invalid or refer to a
`Tensor` that doesn't exist.
- - -
#### `tf.Session.close()` <a class="md-anchor" id="Session.close"></a>
Closes this session.
Calling this method frees all resources associated with the session.
##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
* <b>`RuntimeError`</b>: If an error occurs while closing the session.
- - -
#### `tf.Session.graph` <a class="md-anchor" id="Session.graph"></a>
The graph that was launched in this session.
- - -
#### `tf.Session.as_default()` <a class="md-anchor" id="Session.as_default"></a>
Returns a context manager that makes this object the default session.
Use with the `with` keyword to specify that calls to
[`Operation.run()`](../../api_docs/python/framework.md#Operation.run) or
[`Tensor.run()`](../../api_docs/python/framework.md#Tensor.run) should be
executed in this session.
```python
c = tf.constant(..)
sess = tf.Session()
with sess.as_default():
assert tf.get_default_session() is sess
print c.eval()
```
To get the current default session, use
[`tf.get_default_session()`](#get_default_session).
*N.B.* The `as_default` context manager *does not* close the
session when you exit the context, and you must close the session
explicitly.
```python
c = tf.constant(...)
sess = tf.Session()
with sess.as_default():
print c.eval()
# ...
with sess.as_default():
print c.eval()
sess.close()
```
Alternatively, you can use `with tf.Session():` to create a
session that is automatically closed on exiting the context,
including when an uncaught exception is raised.
*N.B.* The default graph is a property of the current thread. If you
create a new thread, and wish to use the default session in that
thread, you must explicitly add a `with sess.as_default():` in that
thread's function.
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
A context manager using this session as the default session.
- - -
### `class tf.InteractiveSession` <a class="md-anchor" id="InteractiveSession"></a>
A TensorFlow `Session` for use in interactive contexts, such as a shell.
The only difference with a regular `Session` is that an `InteractiveSession`
installs itself as the default session on construction.
The methods [`Tensor.eval()`](../../api_docs/python/framework.md#Tensor.eval)
and [`Operation.run()`](../../api_docs/python/framework.md#Operation.run)
will use that session to run ops.
This is convenient in interactive shells and [IPython
notebooks](http://ipython.org), as it avoids having to pass an explicit
`Session` object to run ops.
For example:
```python
sess = tf.InteractiveSession()
a = tf.constant(5.0)
b = tf.constant(6.0)
c = a * b
# We can just use 'c.eval()' without passing 'sess'
print c.eval()
sess.close()
```
Note that a regular session installs itself as the default session when it
is created in a `with` statement. The common usage in non-interactive
programs is to follow that pattern:
```python
a = tf.constant(5.0)
b = tf.constant(6.0)
c = a * b
with tf.Session():
# We can also use 'c.eval()' here.
print c.eval()
```
- - -
#### `tf.InteractiveSession.__init__(target='', graph=None)` <a class="md-anchor" id="InteractiveSession.__init__"></a>
Creates a new interactive TensorFlow session.
If no `graph` argument is specified when constructing the session,
the default graph will be launched in the session. If you are
using more than one graph (created with `tf.Graph()` in the same
process, you will have to use different sessions for each graph,
but each graph can be used in multiple sessions. In this case, it
is often clearer to pass the graph to be launched explicitly to
the session constructor.
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`target`</b>: (Optional.) The execution engine to connect to.
Defaults to using an in-process engine. At present, no value
other than the empty string is supported.
* <b>`graph`</b>: (Optional.) The `Graph` to be launched (described above).
- - -
#### `tf.InteractiveSession.close()` <a class="md-anchor" id="InteractiveSession.close"></a>
Closes an `InteractiveSession`.
- - -
### `tf.get_default_session()` <a class="md-anchor" id="get_default_session"></a>
Returns the default session for the current thread.
The returned `Session` will be the innermost session on which a
`Session` or `Session.as_default()` context has been entered.
*N.B.* The default session is a property of the current thread. If you
create a new thread, and wish to use the default session in that
thread, you must explicitly add a `with sess.as_default():` in that
thread's function.
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
The default `Session` being used in the current thread.
## Error classes <a class="md-anchor" id="AUTOGENERATED-error-classes"></a>
- - -
### `class tf.OpError` <a class="md-anchor" id="OpError"></a>
A generic error that is raised when TensorFlow execution fails.
Whenever possible, the session will raise a more specific subclass
of `OpError` from the `tf.errors` module.
- - -
#### `tf.OpError.op` <a class="md-anchor" id="OpError.op"></a>
The operation that failed, if known.
*N.B.* If the failed op was synthesized at runtime, e.g. a `Send`
or `Recv` op, there will be no corresponding
[`Operation`](../../api_docs/python/framework.md#Operation) object. In that case, this
will return `None`, and you should instead use the
[`OpError.node_def`](#OpError.node_def) to discover information about the
op.
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
The `Operation` that failed, or None.
- - -
#### `tf.OpError.node_def` <a class="md-anchor" id="OpError.node_def"></a>
The `NodeDef` proto representing the op that failed.
#### Other Methods <a class="md-anchor" id="AUTOGENERATED-other-methods"></a>
- - -
#### `tf.OpError.__init__(node_def, op, message, error_code)` <a class="md-anchor" id="OpError.__init__"></a>
Creates a new OpError indicating that a particular op failed.
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`node_def`</b>: The graph_pb2.NodeDef proto representing the op that failed.
* <b>`op`</b>: The ops.Operation that failed, if known; otherwise None.
* <b>`message`</b>: The message string describing the failure.
* <b>`error_code`</b>: The error_codes_pb2.Code describing the error.
- - -
#### `tf.OpError.error_code` <a class="md-anchor" id="OpError.error_code"></a>
The integer error code that describes the error.
- - -
#### `tf.OpError.message` <a class="md-anchor" id="OpError.message"></a>
The error message that describes the error.
- - -
### `class tf.errors.CancelledError` <a class="md-anchor" id="CancelledError"></a>
Raised when an operation or step is cancelled.
For example, a long-running operation (e.g.
[`queue.enqueue()`](../../api_docs/python/io_ops.md#QueueBase.enqueue) may be
cancelled by running another operation (e.g.
[`queue.close(cancel_pending_enqueues=True)`](../../api_docs/python/io_ops.md#QueueBase.close),
or by [closing the session](../../api_docs/python/client.md#Session.close).
A step that is running such a long-running operation will fail by raising
`CancelledError`.
- - -
#### `tf.errors.CancelledError.__init__(node_def, op, message)` <a class="md-anchor" id="CancelledError.__init__"></a>
Creates a `CancelledError`.
- - -
### `class tf.errors.UnknownError` <a class="md-anchor" id="UnknownError"></a>
Unknown error.
An example of where this error may be returned is if a Status value
received from another address space belongs to an error-space that
is not known to this address space. Also errors raised by APIs that
do not return enough error information may be converted to this
error.
- - -
#### `tf.errors.UnknownError.__init__(node_def, op, message, error_code=2)` <a class="md-anchor" id="UnknownError.__init__"></a>
Creates an `UnknownError`.
- - -
### `class tf.errors.InvalidArgumentError` <a class="md-anchor" id="InvalidArgumentError"></a>
Raised when an operation receives an invalid argument.
This may occur, for example, if an operation is receives an input
tensor that has an invalid value or shape. For example, the
[`tf.matmul()`](../../api_docs/python/math_ops.md#matmul) op will raise this
error if it receives an input that is not a matrix, and the
[`tf.reshape()`](../../api_docs/python/array_ops.md#reshape) op will raise
this error if the new shape does not match the number of elements in the input
tensor.
- - -
#### `tf.errors.InvalidArgumentError.__init__(node_def, op, message)` <a class="md-anchor" id="InvalidArgumentError.__init__"></a>
Creates an `InvalidArgumentError`.
- - -
### `class tf.errors.DeadlineExceededError` <a class="md-anchor" id="DeadlineExceededError"></a>
Raised when a deadline expires before an operation could complete.
This exception is not currently used.
- - -
#### `tf.errors.DeadlineExceededError.__init__(node_def, op, message)` <a class="md-anchor" id="DeadlineExceededError.__init__"></a>
Creates a `DeadlineExceededError`.
- - -
### `class tf.errors.NotFoundError` <a class="md-anchor" id="NotFoundError"></a>
Raised when a requested entity (e.g., a file or directory) was not found.
For example, running the
[`tf.WholeFileReader.read()`](../../api_docs/python/io_ops.md#WholeFileReader)
operation could raise `NotFoundError` if it receives the name of a file that
does not exist.
- - -
#### `tf.errors.NotFoundError.__init__(node_def, op, message)` <a class="md-anchor" id="NotFoundError.__init__"></a>
Creates a `NotFoundError`.
- - -
### `class tf.errors.AlreadyExistsError` <a class="md-anchor" id="AlreadyExistsError"></a>
Raised when an entity that we attempted to create already exists.
For example, running an operation that saves a file
(e.g. [`tf.train.Saver.save()`](../../api_docs/python/train.md#Saver.save))
could potentially raise this exception if an explicit filename for an
existing file was passed.
- - -
#### `tf.errors.AlreadyExistsError.__init__(node_def, op, message)` <a class="md-anchor" id="AlreadyExistsError.__init__"></a>
Creates an `AlreadyExistsError`.
- - -
### `class tf.errors.PermissionDeniedError` <a class="md-anchor" id="PermissionDeniedError"></a>
Raised when the caller does not have permission to run an operation.
For example, running the
[`tf.WholeFileReader.read()`](../../api_docs/python/io_ops.md#WholeFileReader)
operation could raise `PermissionDeniedError` if it receives the name of a
file for which the user does not have the read file permission.
- - -
#### `tf.errors.PermissionDeniedError.__init__(node_def, op, message)` <a class="md-anchor" id="PermissionDeniedError.__init__"></a>
Creates a `PermissionDeniedError`.
- - -
### `class tf.errors.UnauthenticatedError` <a class="md-anchor" id="UnauthenticatedError"></a>
The request does not have valid authentication credentials.
This exception is not currently used.
- - -
#### `tf.errors.UnauthenticatedError.__init__(node_def, op, message)` <a class="md-anchor" id="UnauthenticatedError.__init__"></a>
Creates an `UnauthenticatedError`.
- - -
### `class tf.errors.ResourceExhaustedError` <a class="md-anchor" id="ResourceExhaustedError"></a>
Some resource has been exhausted.
For example, this error might be raised if a per-user quota is
exhausted, or perhaps the entire file system is out of space.
- - -
#### `tf.errors.ResourceExhaustedError.__init__(node_def, op, message)` <a class="md-anchor" id="ResourceExhaustedError.__init__"></a>
Creates a `ResourceExhaustedError`.
- - -
### `class tf.errors.FailedPreconditionError` <a class="md-anchor" id="FailedPreconditionError"></a>
Operation was rejected because the system is not in a state to execute it.
This exception is most commonly raised when running an operation
that reads a [`tf.Variable`](../../api_docs/python/state_ops.md#Variable)
before it has been initialized.
- - -
#### `tf.errors.FailedPreconditionError.__init__(node_def, op, message)` <a class="md-anchor" id="FailedPreconditionError.__init__"></a>
Creates a `FailedPreconditionError`.
- - -
### `class tf.errors.AbortedError` <a class="md-anchor" id="AbortedError"></a>
The operation was aborted, typically due to a concurrent action.
For example, running a
[`queue.enqueue()`](../../api_docs/python/io_ops.md#QueueBase.enqueue)
operation may raise `AbortedError` if a
[`queue.close()`](../../api_docs/python/io_ops.md#QueueBase.close) operation
previously ran.
- - -
#### `tf.errors.AbortedError.__init__(node_def, op, message)` <a class="md-anchor" id="AbortedError.__init__"></a>
Creates an `AbortedError`.
- - -
### `class tf.errors.OutOfRangeError` <a class="md-anchor" id="OutOfRangeError"></a>
Raised when an operation executed past the valid range.
This exception is raised in "end-of-file" conditions, such as when a
[`queue.dequeue()`](../../api_docs/python/io_ops.md#QueueBase.dequeue)
operation is blocked on an empty queue, and a
[`queue.close()`](../../api_docs/python/io_ops.md#QueueBase.close)
operation executes.
- - -
#### `tf.errors.OutOfRangeError.__init__(node_def, op, message)` <a class="md-anchor" id="OutOfRangeError.__init__"></a>
Creates an `OutOfRangeError`.
- - -
### `class tf.errors.UnimplementedError` <a class="md-anchor" id="UnimplementedError"></a>
Raised when an operation has not been implemented.
Some operations may raise this error when passed otherwise-valid
arguments that it does not currently support. For example, running
the [`tf.nn.max_pool()`](../../api_docs/python/nn.md#max_pool) operation
would raise this error if pooling was requested on the batch dimension,
because this is not yet supported.
- - -
#### `tf.errors.UnimplementedError.__init__(node_def, op, message)` <a class="md-anchor" id="UnimplementedError.__init__"></a>
Creates an `UnimplementedError`.
- - -
### `class tf.errors.InternalError` <a class="md-anchor" id="InternalError"></a>
Raised when the system experiences an internal error.
This exception is raised when some invariant expected by the runtime
has been broken. Catching this exception is not recommended.
- - -
#### `tf.errors.InternalError.__init__(node_def, op, message)` <a class="md-anchor" id="InternalError.__init__"></a>
Creates an `InternalError`.
- - -
### `class tf.errors.UnavailableError` <a class="md-anchor" id="UnavailableError"></a>
Raised when the runtime is currently unavailable.
This exception is not currently used.
- - -
#### `tf.errors.UnavailableError.__init__(node_def, op, message)` <a class="md-anchor" id="UnavailableError.__init__"></a>
Creates an `UnavailableError`.
- - -
### `class tf.errors.DataLossError` <a class="md-anchor" id="DataLossError"></a>
Raised when unrecoverable data loss or corruption is encountered.
For example, this may be raised by running a
[`tf.WholeFileReader.read()`](../../api_docs/python/io_ops.md#WholeFileReader)
operation, if the file is truncated while it is being read.
- - -
#### `tf.errors.DataLossError.__init__(node_def, op, message)` <a class="md-anchor" id="DataLossError.__init__"></a>
Creates a `DataLossError`.
================================================
FILE: SOURCE/api_docs/python/constant_op.md
================================================
<!-- This file is machine generated: DO NOT EDIT! -->
# Constants, Sequences, and Random Values <a class="md-anchor" id="AUTOGENERATED-constants--sequences--and-random-values"></a>
Note: Functions taking `Tensor` arguments can also take anything accepted by
[`tf.convert_to_tensor`](../../api_docs/python/framework.md#convert_to_tensor).
<!-- TOC-BEGIN This section is generated by neural network: DO NOT EDIT! -->
## Contents
### [Constants, Sequences, and Random Values](#AUTOGENERATED-constants--sequences--and-random-values)
* [Constant Value Tensors](#AUTOGENERATED-constant-value-tensors)
* [`tf.zeros(shape, dtype=tf.float32, name=None)`](#zeros)
* [`tf.zeros_like(tensor, dtype=None, name=None)`](#zeros_like)
* [`tf.ones(shape, dtype=tf.float32, name=None)`](#ones)
* [`tf.ones_like(tensor, dtype=None, name=None)`](#ones_like)
* [`tf.fill(dims, value, name=None)`](#fill)
* [`tf.constant(value, dtype=None, shape=None, name='Const')`](#constant)
* [Sequences](#AUTOGENERATED-sequences)
* [`tf.linspace(start, stop, num, name=None)`](#linspace)
* [`tf.range(start, limit, delta=1, name='range')`](#range)
* [Random Tensors](#AUTOGENERATED-random-tensors)
* [Examples:](#AUTOGENERATED-examples-)
* [`tf.random_normal(shape, mean=0.0, stddev=1.0, dtype=tf.float32, seed=None, name=None)`](#random_normal)
* [`tf.truncated_normal(shape, mean=0.0, stddev=1.0, dtype=tf.float32, seed=None, name=None)`](#truncated_normal)
* [`tf.random_uniform(shape, minval=0.0, maxval=1.0, dtype=tf.float32, seed=None, name=None)`](#random_uniform)
* [`tf.random_shuffle(value, seed=None, name=None)`](#random_shuffle)
* [`tf.set_random_seed(seed)`](#set_random_seed)
<!-- TOC-END This section was generated by neural network, THANKS FOR READING! -->
## Constant Value Tensors <a class="md-anchor" id="AUTOGENERATED-constant-value-tensors"></a>
TensorFlow provides several operations that you can use to generate constants.
- - -
### `tf.zeros(shape, dtype=tf.float32, name=None)` <a class="md-anchor" id="zeros"></a>
Creates a tensor with all elements set to zero.
This operation returns a tensor of type `dtype` with shape `shape` and
all elements set to zero.
For example:
```python
tf.zeros([3, 4], int32) ==> [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]
```
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`shape`</b>: Either a list of integers, or a 1-D `Tensor` of type `int32`.
* <b>`dtype`</b>: The type of an element in the resulting `Tensor`.
* <b>`name`</b>: A name for the operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
A `Tensor` with all elements set to zero.
- - -
### `tf.zeros_like(tensor, dtype=None, name=None)` <a class="md-anchor" id="zeros_like"></a>
Creates a tensor with all elements set to zero.
Given a single tensor (`tensor`), this operation returns a tensor of the
same type and shape as `tensor` with all elements set to zero. Optionally,
you can use `dtype` to specify a new type for the returned tensor.
For example:
```python
# 'tensor' is [[1, 2, 3], [4, 5, 6]]
tf.zeros_like(tensor) ==> [[0, 0, 0], [0, 0, 0]]
```
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`tensor`</b>: A `Tensor`.
* <b>`dtype`</b>: A type for the returned `Tensor`. Must be `float32`, `float64`,
`int8`, `int16`, `int32`, `int64`, `uint8`, or `complex64`.
* <b>`name`</b>: A name for the operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
A `Tensor` with all elements set to zero.
- - -
### `tf.ones(shape, dtype=tf.float32, name=None)` <a class="md-anchor" id="ones"></a>
Creates a tensor with all elements set to 1.
This operation returns a tensor of type `dtype` with shape `shape` and all
elements set to 1.
For example:
```python
tf.ones([2, 3], int32) ==> [[1, 1, 1], [1, 1, 1]]
```
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`shape`</b>: Either a list of integers, or a 1-D `Tensor` of type `int32`.
* <b>`dtype`</b>: The type of an element in the resulting `Tensor`.
* <b>`name`</b>: A name for the operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
A `Tensor` with all elements set to 1.
- - -
### `tf.ones_like(tensor, dtype=None, name=None)` <a class="md-anchor" id="ones_like"></a>
Creates a tensor with all elements set to 1.
Given a single tensor (`tensor`), this operation returns a tensor of the same
type and shape as `tensor` with all elements set to 1. Optionally, you can
specify a new type (`dtype`) for the returned tensor.
For example:
```python
# 'tensor' is [[1, 2, 3], [4, 5, 6]]
tf.ones_like(tensor) ==> [[1, 1, 1], [1, 1, 1]]
```
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`tensor`</b>: A `Tensor`.
* <b>`dtype`</b>: A type for the returned `Tensor`. Must be `float32`, `float64`,
`int8`, `int16`, `int32`, `int64`, `uint8`, or `complex64`.
* <b>`name`</b>: A name for the operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
A `Tensor` with all elements set to 1.
- - -
### `tf.fill(dims, value, name=None)` <a class="md-anchor" id="fill"></a>
Creates a tensor filled with a scalar value.
This operation creates a tensor of shape `dims` and fills it with `value`.
For example:
```prettyprint
# output tensor shape needs to be [2, 3]
# so 'dims' is [2, 3]
fill(dims, 9) ==> [[9, 9, 9]
[9, 9, 9]]
```
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`dims`</b>: A `Tensor` of type `int32`.
1-D. Represents the shape of the output tensor.
* <b>`value`</b>: A `Tensor`. 0-D (scalar). Value to fill the returned tensor.
* <b>`name`</b>: A name for the operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
A `Tensor`. Has the same type as `value`.
- - -
### `tf.constant(value, dtype=None, shape=None, name='Const')` <a class="md-anchor" id="constant"></a>
Creates a constant tensor.
The resulting tensor is populated with values of type `dtype`, as
specified by arguments `value` and (optionally) `shape` (see examples
below).
The argument `value` can be a constant value, or a list of values of type
`dtype`. If `value` is a list, then the length of the list must be less
than or equal to the number of elements implied by the `shape` argument (if
specified). In the case where the list length is less than the number of
elements specified by `shape`, the last element in the list will be used
to fill the remaining entries.
The argument `shape` is optional. If present, it specifies the dimensions
of the resulting tensor. If not present, then the tensor is a scalar (0-D)
if `value` is a scalar, or 1-D otherwise.
If the argument `dtype` is not specified, then the type is inferred from
the type of `value`.
For example:
```python
# Constant 1-D Tensor populated with value list.
tensor = tf.constant([1, 2, 3, 4, 5, 6, 7]) => [1 2 3 4 5 6 7]
# Constant 2-D tensor populated with scalar value -1.
tensor = tf.constant(-1.0, shape=[2, 3]) => [[-1. -1. -1.]
[-1. -1. -1.]]
```
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`value`</b>: A constant value (or list) of output type `dtype`.
* <b>`dtype`</b>: The type of the elements of the resulting tensor.
* <b>`shape`</b>: Optional dimensions of resulting tensor.
* <b>`name`</b>: Optional name for the tensor.
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
A Constant Tensor.
## Sequences <a class="md-anchor" id="AUTOGENERATED-sequences"></a>
- - -
### `tf.linspace(start, stop, num, name=None)` <a class="md-anchor" id="linspace"></a>
Generates values in an interval.
A sequence of `num` evenly-spaced values are generated beginning at `start`.
If `num > 1`, the values in the sequence increase by `stop - start / num - 1`,
so that the last one is exactly `stop`.
For example:
```
tf.linspace(10.0, 12.0, 3, name="linspace") => [ 10.0 11.0 12.0]
```
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`start`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`.
First entry in the range.
* <b>`stop`</b>: A `Tensor`. Must have the same type as `start`.
Last entry in the range.
* <b>`num`</b>: A `Tensor` of type `int32`. Number of values to generate.
* <b>`name`</b>: A name for the operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
A `Tensor`. Has the same type as `start`. 1-D. The generated values.
- - -
### `tf.range(start, limit, delta=1, name='range')` <a class="md-anchor" id="range"></a>
Creates a sequence of integers.
This operation creates a sequence of integers that begins at `start` and
extends by increments of `delta` up to but not including `limit`.
For example:
```
# 'start' is 3
# 'limit' is 18
# 'delta' is 3
tf.range(start, limit, delta) ==> [3, 6, 9, 12, 15]
```
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`start`</b>: A 0-D (scalar) of type `int32`. First entry in sequence.
* <b>`limit`</b>: A 0-D (scalar) of type `int32`. Upper limit of sequence,
exclusive.
* <b>`delta`</b>: A 0-D `Tensor` (scalar) of type `int32`. Optional. Default is 1.
Number that increments `start`.
* <b>`name`</b>: A name for the operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
An 1-D `int32` `Tensor`.
## Random Tensors <a class="md-anchor" id="AUTOGENERATED-random-tensors"></a>
TensorFlow has several ops that create random tensors with different
distributions. The random ops are stateful, and create new random values each
time they are evaluated.
The `seed` keyword argument in these functions acts in conjunction with
the graph-level random seed. Changing either the graph-level seed using
[`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed) or the
op-level seed will change the underlying seed of these operations. Setting
neither graph-level nor op-level seed, results in a random seed for all
operations.
See [`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed)
for details on the interaction between operation-level and graph-level random
seeds.
### Examples: <a class="md-anchor" id="AUTOGENERATED-examples-"></a>
```python
# Create a tensor of shape [2, 3] consisting of random normal values, with mean
# -1 and standard deviation 4.
norm = tf.random_normal([2, 3], mean=-1, stddev=4)
# Shuffle the first dimension of a tensor
c = tf.constant([[1, 2], [3, 4], [5, 6]])
shuff = tf.random_shuffle(c)
# Each time we run these ops, different results are generated
sess = tf.Session()
print sess.run(norm)
print sess.run(norm)
# Set an op-level seed to generate repeatable sequences across sessions.
c = tf.constant([[1, 2], [3, 4], [5, 6]])
sess = tf.Session()
norm = tf.random_normal(c, seed=1234)
print sess.run(norm)
print sess.run(norm)
```
Another common use of random values is the intialization of variables. Also see
the [Variables How To](../../how_tos/variables/index.md).
```python
# Use random uniform values in [0, 1) as the initializer for a variable of shape
# [2, 3]. The default type is float32.
var = tf.Variable(tf.random_uniform([2, 3]), name="var")
init = tf.initialize_all_variables()
sess = tf.Session()
sess.run(init)
print sess.run(var)
```
- - -
### `tf.random_normal(shape, mean=0.0, stddev=1.0, dtype=tf.float32, seed=None, name=None)` <a class="md-anchor" id="random_normal"></a>
Outputs random values from a normal distribution.
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`shape`</b>: A 1-D integer Tensor or Python array. The shape of the output tensor.
* <b>`mean`</b>: A 0-D Tensor or Python value of type `dtype`. The mean of the normal
distribution.
* <b>`stddev`</b>: A 0-D Tensor or Python value of type `dtype`. The standard deviation
of the normal distribution.
* <b>`dtype`</b>: The type of the output.
* <b>`seed`</b>: A Python integer. Used to create a random seed for the distribution.
See
[`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed)
for behavior.
* <b>`name`</b>: A name for the operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
A tensor of the specified shape filled with random normal values.
- - -
### `tf.truncated_normal(shape, mean=0.0, stddev=1.0, dtype=tf.float32, seed=None, name=None)` <a class="md-anchor" id="truncated_normal"></a>
Outputs random values from a truncated normal distribution.
The generated values follow a normal distribution with specified mean and
standard deviation, except that values whose magnitude is more than 2 standard
deviations from the mean are dropped and re-picked.
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`shape`</b>: A 1-D integer Tensor or Python array. The shape of the output tensor.
* <b>`mean`</b>: A 0-D Tensor or Python value of type `dtype`. The mean of the
truncated normal distribution.
* <b>`stddev`</b>: A 0-D Tensor or Python value of type `dtype`. The standard deviation
of the truncated normal distribution.
* <b>`dtype`</b>: The type of the output.
* <b>`seed`</b>: A Python integer. Used to create a random seed for the distribution.
See
[`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed)
for behavior.
* <b>`name`</b>: A name for the operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
A tensor of the specified shape filled with random truncated normal values.
- - -
### `tf.random_uniform(shape, minval=0.0, maxval=1.0, dtype=tf.float32, seed=None, name=None)` <a class="md-anchor" id="random_uniform"></a>
Outputs random values from a uniform distribution.
The generated values follow a uniform distribution in the range
`[minval, maxval)`. The lower bound `minval` is included in the range, while
the upper bound `maxval` is excluded.
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`shape`</b>: A 1-D integer Tensor or Python array. The shape of the output tensor.
* <b>`minval`</b>: A 0-D Tensor or Python value of type `dtype`. The lower bound on the
range of random values to generate.
* <b>`maxval`</b>: A 0-D Tensor or Python value of type `dtype`. The upper bound on
the range of random values to generate.
* <b>`dtype`</b>: The type of the output.
* <b>`seed`</b>: A Python integer. Used to create a random seed for the distribution.
See
[`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed)
for behavior.
* <b>`name`</b>: A name for the operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
A tensor of the specified shape filled with random uniform values.
- - -
### `tf.random_shuffle(value, seed=None, name=None)` <a class="md-anchor" id="random_shuffle"></a>
Randomly shuffles a tensor along its first dimension.
The tensor is shuffled along dimension 0, such that each `value[j]` is mapped
to one and only one `output[i]`. For example, a mapping that might occur for a
3x2 tensor is:
```python
[[1, 2], [[5, 6],
[3, 4], ==> [1, 2],
[5, 6]] [3, 4]]
```
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`value`</b>: A Tensor to be shuffled.
* <b>`seed`</b>: A Python integer. Used to create a random seed for the distribution.
See
[`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed)
for behavior.
* <b>`name`</b>: A name for the operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
A tensor of same shape and type as `value`, shuffled along its first
dimension.
- - -
### `tf.set_random_seed(seed)` <a class="md-anchor" id="set_random_seed"></a>
Sets the graph-level random seed.
Operations that rely on a random seed actually derive it from two seeds:
the graph-level and operation-level seeds. This sets the graph-level seed.
Its interactions with operation-level seeds is as follows:
1. If neither the graph-level nor the operation seed is set:
A random seed is used for this op.
2. If the graph-level seed is set, but the operation seed is not:
The system deterministically picks an operation seed in conjunction
with the graph-level seed so that it gets a unique random sequence.
3. If the graph-level seed is not set, but the operation seed is set:
A default graph-level seed and the specified operation seed are used to
determine the random sequence.
4. If both the graph-level and the operation seed are set:
Both seeds are used in conjunction to determine the random sequence.
To illustrate the user-visible effects, consider these examples:
To generate different sequences across sessions, set neither
graph-level nor op-level seeds:
```python
a = tf.random_uniform([1])
b = tf.random_normal([1])
print "Session 1"
with tf.Session() as sess1:
print sess1.run(a) # generates 'A1'
print sess1.run(a) # generates 'A2'
print sess1.run(b) # generates 'B1'
print sess1.run(b) # generates 'B2'
print "Session 2"
with tf.Session() as sess2:
print sess2.run(a) # generates 'A3'
print sess2.run(a) # generates 'A4'
print sess2.run(b) # generates 'B3'
print sess2.run(b) # generates 'B4'
```
To generate the same repeatable sequence for an op across sessions, set the
seed for the op:
```python
a = tf.random_uniform([1], seed=1)
b = tf.random_normal([1])
# Repeatedly running this block with the same graph will generate the same
# sequence of values for 'a', but different sequences of values for 'b'.
print "Session 1"
with tf.Session() as sess1:
print sess1.run(a) # generates 'A1'
print sess1.run(a) # generates 'A2'
print sess1.run(b) # generates 'B1'
print sess1.run(b) # generates 'B2'
print "Session 2"
with tf.Session() as sess2:
print sess2.run(a) # generates 'A1'
print sess2.run(a) # generates 'A2'
print sess2.run(b) # generates 'B3'
print sess2.run(b) # generates 'B4'
```
To make the random sequences generated by all ops be repeatable across
sessions, set a graph-level seed:
```python
tf.set_random_seed(1234)
a = tf.random_uniform([1])
b = tf.random_normal([1])
# Repeatedly running this block with the same graph will generate different
# sequences of 'a' and 'b'.
print "Session 1"
with tf.Session() as sess1:
print sess1.run(a) # generates 'A1'
print sess1.run(a) # generates 'A2'
print sess1.run(b) # generates 'B1'
print sess1.run(b) # generates 'B2'
print "Session 2"
with tf.Session() as sess2:
print sess2.run(a) # generates 'A1'
print sess2.run(a) # generates 'A2'
print sess2.run(b) # generates 'B1'
print sess2.run(b) # generates 'B2'
```
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`seed`</b>: integer.
================================================
FILE: SOURCE/api_docs/python/control_flow_ops.md
================================================
<!-- This file is machine generated: DO NOT EDIT! -->
# Control Flow <a class="md-anchor" id="AUTOGENERATED-control-flow"></a>
Note: Functions taking `Tensor` arguments can also take anything accepted by
[`tf.convert_to_tensor`](../../api_docs/python/framework.md#convert_to_tensor).
<!-- TOC-BEGIN This section is generated by neural network: DO NOT EDIT! -->
## Contents
### [Control Flow](#AUTOGENERATED-control-flow)
* [Control Flow Operations](#AUTOGENERATED-control-flow-operations)
* [`tf.identity(input, name=None)`](#identity)
* [`tf.tuple(tensors, name=None, control_inputs=None)`](#tuple)
* [`tf.group(*inputs, **kwargs)`](#group)
* [`tf.no_op(name=None)`](#no_op)
* [`tf.count_up_to(ref, limit, name=None)`](#count_up_to)
* [Logical Operators](#AUTOGENERATED-logical-operators)
* [`tf.logical_and(x, y, name=None)`](#logical_and)
* [`tf.logical_not(x, name=None)`](#logical_not)
* [`tf.logical_or(x, y, name=None)`](#logical_or)
* [`tf.logical_xor(x, y, name='LogicalXor')`](#logical_xor)
* [Comparison Operators](#AUTOGENERATED-comparison-operators)
* [`tf.equal(x, y, name=None)`](#equal)
* [`tf.not_equal(x, y, name=None)`](#not_equal)
* [`tf.less(x, y, name=None)`](#less)
* [`tf.less_equal(x, y, name=None)`](#less_equal)
* [`tf.greater(x, y, name=None)`](#greater)
* [`tf.greater_equal(x, y, name=None)`](#greater_equal)
* [`tf.select(condition, t, e, name=None)`](#select)
* [`tf.where(input, name=None)`](#where)
* [Debugging Operations](#AUTOGENERATED-debugging-operations)
* [`tf.is_finite(x, name=None)`](#is_finite)
* [`tf.is_inf(x, name=None)`](#is_inf)
* [`tf.is_nan(x, name=None)`](#is_nan)
* [`tf.verify_tensor_all_finite(t, msg, name=None)`](#verify_tensor_all_finite)
* [`tf.check_numerics(tensor, message, name=None)`](#check_numerics)
* [`tf.add_check_numerics_ops()`](#add_check_numerics_ops)
* [`tf.Assert(condition, data, summarize=None, name=None)`](#Assert)
* [`tf.Print(input_, data, message=None, first_n=None, summarize=None, name=None)`](#Print)
<!-- TOC-END This section was generated by neural network, THANKS FOR READING! -->
## Control Flow Operations <a class="md-anchor" id="AUTOGENERATED-control-flow-operations"></a>
TensorFlow provides several operations and classes that you can use to control
the execution of operations and add conditional dependencies to your graph.
- - -
### `tf.identity(input, name=None)` <a class="md-anchor" id="identity"></a>
Return a tensor with the same shape and contents as the input tensor or value.
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`input`</b>: A `Tensor`.
* <b>`name`</b>: A name for the operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
A `Tensor`. Has the same type as `input`.
- - -
### `tf.tuple(tensors, name=None, control_inputs=None)` <a class="md-anchor" id="tuple"></a>
Group tensors together.
This creates a tuple of tensors with the same values as the `tensors`
argument, except that the value of each tensor is only returned after the
values of all tensors have been computed.
`control_inputs` contains additional ops that have to finish before this op
finishes, but whose outputs are not returned.
This can be used as a "join" mechanism for parallel computations: all the
argument tensors can be computed in parallel, but the values of any tensor
returned by `tuple` are only available after all the parallel computations
are done.
See also `group` and `with_dependencies`.
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`tensors`</b>: A list of `Tensor`s or `IndexedSlices`, some entries can be `None`.
* <b>`name`</b>: (optional) A name to use as a `name_scope` for the operation.
* <b>`control_inputs`</b>: List of additional ops to finish before returning.
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
Same as `tensors`.
##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
* <b>`ValueError`</b>: If `tensors` does not contain any `Tensor` or `IndexedSlices`.
- - -
### `tf.group(*inputs, **kwargs)` <a class="md-anchor" id="group"></a>
Create an op that groups multiple operations.
When this op finishes, all ops in `input` have finished. This op has no
output.
See also `tuple` and `with_dependencies`.
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`*inputs`</b>: One or more tensors to group.
* <b>`**kwargs`</b>: Optional parameters to pass when constructing the NodeDef.
* <b>`name`</b>: A name for this operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
An Operation that executes all its inputs.
##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
* <b>`ValueError`</b>: If an unknown keyword argument is provided, or if there are
no inputs.
- - -
### `tf.no_op(name=None)` <a class="md-anchor" id="no_op"></a>
Does nothing. Only useful as a placeholder for control edges.
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`name`</b>: A name for the operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
The created Operation.
- - -
### `tf.count_up_to(ref, limit, name=None)` <a class="md-anchor" id="count_up_to"></a>
Increments 'ref' until it reaches 'limit'.
This operation outputs "ref" after the update is done. This makes it
easier to chain operations that need to use the updated value.
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`ref`</b>: A mutable `Tensor`. Must be one of the following types: `int32`, `int64`.
Should be from a scalar `Variable` node.
* <b>`limit`</b>: An `int`.
If incrementing ref would bring it above limit, instead generates an
'OutOfRange' error.
* <b>`name`</b>: A name for the operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
A `Tensor`. Has the same type as `ref`.
A copy of the input before increment. If nothing else modifies the
input, the values produced will all be distinct.
## Logical Operators <a class="md-anchor" id="AUTOGENERATED-logical-operators"></a>
TensorFlow provides several operations that you can use to add logical operators
to your graph.
- - -
### `tf.logical_and(x, y, name=None)` <a class="md-anchor" id="logical_and"></a>
Returns the truth value of x AND y element-wise.
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`x`</b>: A `Tensor` of type `bool`.
* <b>`y`</b>: A `Tensor` of type `bool`.
* <b>`name`</b>: A name for the operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
A `Tensor` of type `bool`.
- - -
### `tf.logical_not(x, name=None)` <a class="md-anchor" id="logical_not"></a>
Returns the truth value of NOT x element-wise.
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`x`</b>: A `Tensor` of type `bool`.
* <b>`name`</b>: A name for the operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
A `Tensor` of type `bool`.
- - -
### `tf.logical_or(x, y, name=None)` <a class="md-anchor" id="logical_or"></a>
Returns the truth value of x OR y element-wise.
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`x`</b>: A `Tensor` of type `bool`.
* <b>`y`</b>: A `Tensor` of type `bool`.
* <b>`name`</b>: A name for the operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
A `Tensor` of type `bool`.
- - -
### `tf.logical_xor(x, y, name='LogicalXor')` <a class="md-anchor" id="logical_xor"></a>
x ^ y = (x | y) & ~(x & y).
## Comparison Operators <a class="md-anchor" id="AUTOGENERATED-comparison-operators"></a>
TensorFlow provides several operations that you can use to add comparison
operators to your graph.
- - -
### `tf.equal(x, y, name=None)` <a class="md-anchor" id="equal"></a>
Returns the truth value of (x == y) element-wise.
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`x`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `int64`, `complex64`, `quint8`, `qint8`, `qint32`.
* <b>`y`</b>: A `Tensor`. Must have the same type as `x`.
* <b>`name`</b>: A name for the operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
A `Tensor` of type `bool`.
- - -
### `tf.not_equal(x, y, name=None)` <a class="md-anchor" id="not_equal"></a>
Returns the truth value of (x != y) element-wise.
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`x`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `int64`, `complex64`, `quint8`, `qint8`, `qint32`.
* <b>`y`</b>: A `Tensor`. Must have the same type as `x`.
* <b>`name`</b>: A name for the operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
A `Tensor` of type `bool`.
- - -
### `tf.less(x, y, name=None)` <a class="md-anchor" id="less"></a>
Returns the truth value of (x < y) element-wise.
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`x`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `int64`.
* <b>`y`</b>: A `Tensor`. Must have the same type as `x`.
* <b>`name`</b>: A name for the operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
A `Tensor` of type `bool`.
- - -
### `tf.less_equal(x, y, name=None)` <a class="md-anchor" id="less_equal"></a>
Returns the truth value of (x <= y) element-wise.
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`x`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `int64`.
* <b>`y`</b>: A `Tensor`. Must have the same type as `x`.
* <b>`name`</b>: A name for the operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
A `Tensor` of type `bool`.
- - -
### `tf.greater(x, y, name=None)` <a class="md-anchor" id="greater"></a>
Returns the truth value of (x > y) element-wise.
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`x`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `int64`.
* <b>`y`</b>: A `Tensor`. Must have the same type as `x`.
* <b>`name`</b>: A name for the operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
A `Tensor` of type `bool`.
- - -
### `tf.greater_equal(x, y, name=None)` <a class="md-anchor" id="greater_equal"></a>
Returns the truth value of (x >= y) element-wise.
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`x`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `int64`.
* <b>`y`</b>: A `Tensor`. Must have the same type as `x`.
* <b>`name`</b>: A name for the operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
A `Tensor` of type `bool`.
- - -
### `tf.select(condition, t, e, name=None)` <a class="md-anchor" id="select"></a>
Selects elements from `t` or `e`, depending on `condition`.
The `condition`, `t`, and `e` tensors must all have the same shape,
and the output will also have that shape. The `condition` tensor acts
as an element-wise mask that chooses, based on the value at each
element, whether the corresponding element in the output should be
taken from `t` (if true) or `e` (if false). For example:
For example:
```prettyprint
# 'condition' tensor is [[True, False]
# [True, False]]
# 't' is [[1, 1],
# [1, 1]]
# 'e' is [[2, 2],
# [2, 2]]
select(condition, t, e) ==> [[1, 2],
[1, 2]]
```
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`condition`</b>: A `Tensor` of type `bool`.
* <b>`t`</b>: A `Tensor` with the same shape as `condition`.
* <b>`e`</b>: A `Tensor` with the same type and shape as `t`.
* <b>`name`</b>: A name for the operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
A `Tensor` with the same type and shape as `t` and `e`.
- - -
### `tf.where(input, name=None)` <a class="md-anchor" id="where"></a>
Returns locations of true values in a boolean tensor.
This operation returns the coordinates of true elements in `input`. The
coordinates are returned in a 2-D tensor where the first dimension (rows)
represents the number of true elements, and the second dimension (columns)
represents the coordinates of the true elements. Keep in mind, the shape of
the output tensor can vary depending on how many true values there are in
`input`. Indices are output in row-major order.
For example:
```prettyprint
# 'input' tensor is [[True, False]
# [True, False]]
# 'input' has two true values, so output has two coordinates.
# 'input' has rank of 2, so coordinates have two indices.
where(input) ==> [[0, 0],
[1, 0]]
# `input` tensor is [[[True, False]
# [True, False]]
# [[False, True]
# [False, True]]
# [[False, False]
# [False, True]]]
# 'input' has 5 true values, so output has 5 coordinates.
# 'input' has rank of 3, so coordinates have three indices.
where(input) ==> [[0, 0, 0],
[0, 1, 0],
[1, 0, 1],
[1, 1, 1],
[2, 1, 1]]
```
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`input`</b>: A `Tensor` of type `bool`.
* <b>`name`</b>: A name for the operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
A `Tensor` of type `int64`.
## Debugging Operations <a class="md-anchor" id="AUTOGENERATED-debugging-operations"></a>
TensorFlow provides several operations that you can use to validate values and
debug your graph.
- - -
### `tf.is_finite(x, name=None)` <a class="md-anchor" id="is_finite"></a>
Returns which elements of x are finite.
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`x`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`.
* <b>`name`</b>: A name for the operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
A `Tensor` of type `bool`.
- - -
### `tf.is_inf(x, name=None)` <a class="md-anchor" id="is_inf"></a>
Returns which elements of x are Inf.
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`x`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`.
* <b>`name`</b>: A name for the operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
A `Tensor` of type `bool`.
- - -
### `tf.is_nan(x, name=None)` <a class="md-anchor" id="is_nan"></a>
Returns which elements of x are NaN.
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`x`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`.
* <b>`name`</b>: A name for the operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
A `Tensor` of type `bool`.
- - -
### `tf.verify_tensor_all_finite(t, msg, name=None)` <a class="md-anchor" id="verify_tensor_all_finite"></a>
Assert that the tensor does not contain any NaN's or Inf's.
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`t`</b>: Tensor to check.
* <b>`msg`</b>: Message to log on failure.
* <b>`name`</b>: A name for this operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
Same tensor as `t`.
- - -
### `tf.check_numerics(tensor, message, name=None)` <a class="md-anchor" id="check_numerics"></a>
Checks a tensor for NaN and Inf values.
When run, reports an `InvalidArgument` error if `tensor` has any values
that are not a number (NaN) or infinity (Inf). Otherwise, passes `tensor` as-is.
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`tensor`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`.
* <b>`message`</b>: A `string`. Prefix of the error message.
* <b>`name`</b>: A name for the operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
A `Tensor`. Has the same type as `tensor`.
- - -
### `tf.add_check_numerics_ops()` <a class="md-anchor" id="add_check_numerics_ops"></a>
Connect a check_numerics to every floating point tensor.
`check_numerics` operations themselves are added for each `float` or `double`
tensor in the graph. For all ops in the graph, the `check_numerics` op for
all of its (`float` or `double`) inputs is guaranteed to run before the
`check_numerics` op on any of its outputs.
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
A `group` op depending on all `check_numerics` ops added.
- - -
### `tf.Assert(condition, data, summarize=None, name=None)` <a class="md-anchor" id="Assert"></a>
Asserts that the given condition is true.
If `condition` evaluates to false, print the list of tensors in `data`.
`summarize` determines how many entries of the tensors to print.
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`condition`</b>: The condition to evaluate.
* <b>`data`</b>: The tensors to print out when condition is false.
* <b>`summarize`</b>: Print this many entries of each tensor.
* <b>`name`</b>: A name for this operation (optional).
- - -
### `tf.Print(input_, data, message=None, first_n=None, summarize=None, name=None)` <a class="md-anchor" id="Print"></a>
Prints a list of tensors.
This is an identity op with the side effect of printing `data` when
evaluating.
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`input_`</b>: A tensor passed through this op.
* <b>`data`</b>: A list of tensors to print out when op is evaluated.
* <b>`message`</b>: A string, prefix of the error message.
* <b>`first_n`</b>: Only log `first_n` number of times. Negative numbers log always;
this is the default.
* <b>`summarize`</b>: Only print this many entries of each tensor.
* <b>`name`</b>: A name for the operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
Same tensor as `input_`.
================================================
FILE: SOURCE/api_docs/python/framework.md
================================================
<!-- This file is machine generated: DO NOT EDIT! -->
# Building Graphs <a class="md-anchor" id="AUTOGENERATED-building-graphs"></a>
<!-- TOC-BEGIN This section is generated by neural network: DO NOT EDIT! -->
## Contents
### [Building Graphs](#AUTOGENERATED-building-graphs)
* [Core graph data structures](#AUTOGENERATED-core-graph-data-structures)
* [`class tf.Graph`](#Graph)
* [`class tf.Operation`](#Operation)
* [`class tf.Tensor`](#Tensor)
* [Tensor types](#AUTOGENERATED-tensor-types)
* [`class tf.DType`](#DType)
* [`tf.as_dtype(type_value)`](#as_dtype)
* [Utility functions](#AUTOGENERATED-utility-functions)
* [`tf.device(dev)`](#device)
* [`tf.name_scope(name)`](#name_scope)
* [`tf.control_dependencies(control_inputs)`](#control_dependencies)
* [`tf.convert_to_tensor(value, dtype=None, name=None)`](#convert_to_tensor)
* [`tf.get_default_graph()`](#get_default_graph)
* [`tf.import_graph_def(graph_def, input_map=None, return_elements=None, name=None, op_dict=None)`](#import_graph_def)
* [Graph collections](#AUTOGENERATED-graph-collections)
* [`tf.add_to_collection(name, value)`](#add_to_collection)
* [`tf.get_collection(key, scope=None)`](#get_collection)
* [`class tf.GraphKeys`](#GraphKeys)
* [Defining new operations](#AUTOGENERATED-defining-new-operations)
* [`class tf.RegisterGradient`](#RegisterGradient)
* [`tf.NoGradient(op_type)`](#NoGradient)
* [`class tf.RegisterShape`](#RegisterShape)
* [`class tf.TensorShape`](#TensorShape)
* [`class tf.Dimension`](#Dimension)
* [`tf.op_scope(values, name, default_name)`](#op_scope)
* [`tf.get_seed(op_seed)`](#get_seed)
<!-- TOC-END This section was generated by neural network, THANKS FOR READING! -->
Classes and functions for building TensorFlow graphs.
## Core graph data structures <a class="md-anchor" id="AUTOGENERATED-core-graph-data-structures"></a>
- - -
### `class tf.Graph` <a class="md-anchor" id="Graph"></a>
A TensorFlow computation, represented as a dataflow graph.
A `Graph` contains a set of
[`Operation`](../../api_docs/python/framework.md#Operation) objects,
which represent units of computation; and
[`Tensor`](../../api_docs/python/framework.md#Tensor) objects, which represent
the units of data that flow between operations.
A default `Graph` is always registered, and accessible by calling
[`tf.get_default_graph()`](../../api_docs/python/framework.md#get_default_graph).
To add an operation to the default graph, simply call one of the functions
that defines a new `Operation`:
```
c = tf.constant(4.0)
assert c.graph is tf.get_default_graph()
```
Another typical usage involves the
[`Graph.as_default()`](../../api_docs/python/framework.md#Graph.as_default)
context manager, which overrides the current default graph for the
lifetime of the context:
```python
g = tf.Graph()
with g.as_default():
# Define operations and tensors in `g`.
c = tf.constant(30.0)
assert c.graph is g
```
Important note: This class *is not* thread-safe for graph construction. All
operations should be created from a single thread, or external
synchronization must be provided. Unless otherwise specified, all methods
are not thread-safe.
- - -
#### `tf.Graph.__init__()` <a class="md-anchor" id="Graph.__init__"></a>
Creates a new, empty Graph.
- - -
#### `tf.Graph.as_default()` <a class="md-anchor" id="Graph.as_default"></a>
Returns a context manager that makes this `Graph` the default graph.
This method should be used if you want to create multiple graphs
in the same process. For convenience, a global default graph is
provided, and all ops will be added to this graph if you do not
create a new graph explicitly. Use this method the `with` keyword
to specify that ops created within the scope of a block should be
added to this graph.
The default graph is a property of the current thread. If you
create a new thread, and wish to use the default graph in that
thread, you must explicitly add a `with g.as_default():` in that
thread's function.
The following code examples are equivalent:
```python
# 1. Using Graph.as_default():
g = tf.Graph()
with g.as_default():
c = tf.constant(5.0)
assert c.graph is g
# 2. Constructing and making default:
with tf.Graph().as_default() as g:
c = tf.constant(5.0)
assert c.graph is g
```
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
A context manager for using this graph as the default graph.
- - -
#### `tf.Graph.as_graph_def(from_version=None)` <a class="md-anchor" id="Graph.as_graph_def"></a>
Returns a serialized `GraphDef` representation of this graph.
The serialized `GraphDef` can be imported into another `Graph`
(using [`import_graph_def()`](#import_graph_def)) or used with the
[C++ Session API](../../api_docs/cc/index.md).
This method is thread-safe.
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`from_version`</b>: Optional. If this is set, returns a `GraphDef`
containing only the nodes that were added to this graph since
its `version` property had the given value.
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
A [`GraphDef`](https://tensorflow.googlesource.com/tensorflow/+/master/tensorflow/core/framework/graph.proto)
protocol buffer.
- - -
#### `tf.Graph.finalize()` <a class="md-anchor" id="Graph.finalize"></a>
Finalizes this graph, making it read-only.
After calling `g.finalize()`, no new operations can be added to
`g`. This method is used to ensure that no operations are added
to a graph when it is shared between multiple threads, for example
when using a [`QueueRunner`](../../api_docs/python/train.md#QueueRunner).
- - -
#### `tf.Graph.finalized` <a class="md-anchor" id="Graph.finalized"></a>
True if this graph has been finalized.
- - -
#### `tf.Graph.control_dependencies(control_inputs)` <a class="md-anchor" id="Graph.control_dependencies"></a>
Returns a context manager that specifies control dependencies.
Use with the `with` keyword to specify that all operations constructed
within the context should have control dependencies on
`control_inputs`. For example:
```python
with g.control_dependencies([a, b, c]):
# `d` and `e` will only run after `a`, `b`, and `c` have executed.
d = ...
e = ...
```
Multiple calls to `control_dependencies()` can be nested, and in
that case a new `Operation` will have control dependencies on the union
of `control_inputs` from all active contexts.
```python
with g.control_dependencies([a, b]):
# Ops declared here run after `a` and `b`.
with g.control_dependencies([c, d]):
# Ops declared here run after `a`, `b`, `c`, and `d`.
```
*N.B.* The control dependencies context applies *only* to ops that
are constructed within the context. Merely using an op or tensor
in the context does not add a control dependency. The following
example illustrates this point:
```python
# WRONG
def my_func(pred, tensor):
t = tf.matmul(tensor, tensor)
with tf.control_dependencies([pred]):
# The matmul op is created outside the context, so no control
# dependency will be added.
return t
# RIGHT
def my_func(pred, tensor):
with tf.control_dependencies([pred]):
# The matmul op is created in the context, so a control dependency
# will be added.
return tf.matmul(tensor, tensor)
```
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`control_inputs`</b>: A list of `Operation` or `Tensor` objects, which
must be executed or computed before running the operations
defined in the context.
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
A context manager that specifies control dependencies for all
operations constructed within the context.
##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
* <b>`TypeError`</b>: If `control_inputs` is not a list of `Operation` or
`Tensor` objects.
- - -
#### `tf.Graph.device(device_name_or_function)` <a class="md-anchor" id="Graph.device"></a>
Returns a context manager that specifies the default device to use.
The `device_name_or_function` argument may either be a device name
string, a device function, or None:
* If it is a device name string, all operations constructed in
this context will be assigned to the device with that name.
* If it is a function, it will be treated as function from
Operation objects to device name strings, and invoked each time
a new Operation is created. The Operation will be assigned to
the device with the returned name.
* If it is None, the default device will be cleared.
For example:
```python
with g.device('/gpu:0'):
# All operations constructed in this context will be placed
# on GPU 0.
with g.device(None):
# All operations constructed in this context will have no
# assigned device.
# Defines a function from `Operation` to device string.
def matmul_on_gpu(n):
if n.type == "MatMul":
return "/gpu:0"
else:
return "/cpu:0"
with g.device(matmul_on_gpu):
# All operations of type "MatMul" constructed in this context
# will be placed on GPU 0; all other operations will be placed
# on CPU 0.
```
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`device_name_or_function`</b>: The device name or function to use in
the context.
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
A context manager that specifies the default device to use for newly
created ops.
- - -
#### `tf.Graph.name_scope(name)` <a class="md-anchor" id="Graph.name_scope"></a>
Returns a context manager that creates hierarchical names for operations.
A graph maintains a stack of name scopes. A `with name_scope(...):`
statement pushes a new name onto the stack for the lifetime of the context.
The `name` argument will be interpreted as follows:
* A string (not ending with '/') will create a new name scope, in which
`name` is appended to the prefix of all operations created in the
context. If `name` has been used before, it will be made unique by
calling `self.unique_name(name)`.
* A scope previously captured from a `with g.name_scope(...) as
scope:` statement will be treated as an "absolute" name scope, which
makes it possible to re-enter existing scopes.
* A value of `None` or the empty string will reset the current name scope
to the top-level (empty) name scope.
For example:
```python
with tf.Graph().as_default() as g:
c = tf.constant(5.0, name="c")
assert c_1.name == "c"
c_1 = tf.constant(6.0, name="c")
assert c_1.name == "c_1"
# Creates a scope called "nested"
with g.name_scope("nested") as scope:
nested_c = tf.constant(10.0, name="c")
assert nested_c.name == "nested/c"
# Creates a nested scope called "inner".
with g.name_scope("inner"):
nested_inner_c = tf.constant(20.0, name="c")
assert nested_inner_c.name == "nested/inner/c"
# Create a nested scope called "inner_1".
with g.name_scope("inner"):
nested_inner_1_c = tf.constant(30.0, name="c")
assert nested_inner_1_c.name == "nested/inner_1/c"
# Treats `scope` as an absolute name scope, and
# switches to the "nested/" scope.
with g.name_scope(scope):
nested_d = tf.constant(40.0, name="d")
assert nested_d.name == "nested/d"
with g.name_scope(""):
e = tf.constant(50.0, name="e")
assert e.name == "e"
```
The name of the scope itself can be captured by `with
g.name_scope(...) as scope:`, which stores the name of the scope
in the variable `scope`. This value can be used to name an
operation that represents the overall result of executing the ops
in a scope. For example:
```python
inputs = tf.constant(...)
with g.name_scope('my_layer') as scope:
weights = tf.Variable(..., name="weights")
biases = tf.Variable(..., name="biases")
affine = tf.matmul(inputs, weights) + biases
output = tf.nn.relu(affine, name=scope)
```
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`name`</b>: A name for the scope.
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
A context manager that installs `name` as a new name scope.
A `Graph` instance supports an arbitrary number of "collections"
that are identified by name. For convenience when building a large
graph, collections can store groups of related objects: for
example, the `tf.Variable` uses a collection (named
[`tf.GraphKeys.VARIABLES`](../../api_docs/python/framework.md#GraphKeys)) for
all variables that are created during the construction of a graph. The caller
may define additional collections by specifying a new name.
- - -
#### `tf.Graph.add_to_collection(name, value)` <a class="md-anchor" id="Graph.add_to_collection"></a>
Stores `value` in the collection with the given `name`.
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`name`</b>: The key for the collection. For example, the `GraphKeys` class
contains many standard names for collections.
* <b>`value`</b>: The value to add to the collection.
- - -
#### `tf.Graph.get_collection(name, scope=None)` <a class="md-anchor" id="Graph.get_collection"></a>
Returns a list of values in the collection with the given `name`.
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`key`</b>: The key for the collection. For example, the `GraphKeys` class
contains many standard names for collections.
* <b>`scope`</b>: (Optional.) If supplied, the resulting list is filtered to include
only items whose name begins with this string.
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
The list of values in the collection with the given `name`, or
an empty list if no value has been added to that collection. The
list contains the values in the order under which they were
collected.
- - -
#### `tf.Graph.as_graph_element(obj, allow_tensor=True, allow_operation=True)` <a class="md-anchor" id="Graph.as_graph_element"></a>
Returns the object referred to by `obj`, as an `Operation` or `Tensor`.
This function validates that `obj` represents an element of this
graph, and gives an informative error message if it is not.
This function is the canonical way to get/validate an object of
one of the allowed types from an external argument reference in the
Session API.
This method may be called concurrently from multiple threads.
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
* <b>`obj`</b>: A `Tensor`, an `Operation`, or the name of a tensor or operation.
Can also be any object with an `_as_graph_element()` method that returns
a value of one of these types.
* <b>`allow_tensor`</b>: If true, `obj` may refer to a `Tensor`.
* <b>`allow_operation`</b>: If true, `obj` may refer to an `Operation`.
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
The `Tensor` or `Operation` in the Graph corresponding to `obj`.
##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
* <b>`TypeError`</b>: If `obj` is not a type we support attempting to convert
to types.
* <b>`ValueError`</b>: If `obj` is of an appropriate type but invalid. For
example, an invalid string.
* <b>`KeyError`</b>: If `obj` is not an object in the graph.
- - -
#### `tf.Graph.ge
gitextract_iq8tfs9_/
├── .gitignore
├── README.md
├── README副本.md
├── SOURCE/
│ ├── api_docs/
│ │ ├── cc/
│ │ │ ├── ClassEnv.md
│ │ │ ├── ClassEnvWrapper.md
│ │ │ ├── ClassRandomAccessFile.md
│ │ │ ├── ClassSession.md
│ │ │ ├── ClassStatus.md
│ │ │ ├── ClassTensor.md
│ │ │ ├── ClassTensorBuffer.md
│ │ │ ├── ClassTensorShape.md
│ │ │ ├── ClassTensorShapeIter.md
│ │ │ ├── ClassTensorShapeUtils.md
│ │ │ ├── ClassThread.md
│ │ │ ├── ClassWritableFile.md
│ │ │ ├── StructSessionOptions.md
│ │ │ ├── StructState.md
│ │ │ ├── StructTensorShapeDim.md
│ │ │ ├── StructThreadOptions.md
│ │ │ └── index.md
│ │ ├── index.md
│ │ └── python/
│ │ ├── array_ops.md
│ │ ├── client.md
│ │ ├── constant_op.md
│ │ ├── control_flow_ops.md
│ │ ├── framework.md
│ │ ├── image.md
│ │ ├── index.md
│ │ ├── io_ops.md
│ │ ├── math_ops.md
│ │ ├── nn.md
│ │ ├── python_io.md
│ │ ├── sparse_ops.md
│ │ ├── state_ops.md
│ │ └── train.md
│ ├── extras/
│ │ └── README.txt
│ ├── faq.md
│ ├── get_started/
│ │ ├── basic_usage.md
│ │ ├── introduction.md
│ │ └── os_setup.md
│ ├── how_tos/
│ │ ├── __init__.py
│ │ ├── adding_an_op/
│ │ │ ├── __init__.py
│ │ │ ├── attr_examples.cc
│ │ │ ├── fact_test.py
│ │ │ ├── index.md
│ │ │ ├── zero_out_1_test.py
│ │ │ ├── zero_out_2_test.py
│ │ │ ├── zero_out_3_test.py
│ │ │ ├── zero_out_grad_2.py
│ │ │ ├── zero_out_op_kernel_1.cc
│ │ │ ├── zero_out_op_kernel_2.cc
│ │ │ └── zero_out_op_kernel_3.cc
│ │ ├── adding_an_op.md
│ │ ├── graph_viz/
│ │ │ └── index.md
│ │ ├── graph_viz.md
│ │ ├── new_data_formats/
│ │ │ ├── Custom Data Readers.md
│ │ │ └── index.md
│ │ ├── new_data_formats.md
│ │ ├── overview.md
│ │ ├── reading_data/
│ │ │ ├── __init__.py
│ │ │ ├── convert_to_records.py
│ │ │ ├── fully_connected_preloaded.py
│ │ │ ├── fully_connected_preloaded_var.py
│ │ │ ├── fully_connected_reader.py
│ │ │ └── index.md
│ │ ├── reading_data.md
│ │ ├── summaries_and_tensorboard/
│ │ │ └── index.md
│ │ ├── summaries_and_tensorboard.md
│ │ ├── threading_and_queues/
│ │ │ └── index.md
│ │ ├── threading_and_queues.md
│ │ ├── using_gpu/
│ │ │ └── index.md
│ │ ├── using_gpu.md
│ │ ├── variable_scope/
│ │ │ └── index.md
│ │ ├── variable_scope.md
│ │ ├── variables/
│ │ │ └── index.md
│ │ └── variables.md
│ ├── images/
│ │ └── getting_started.dot
│ ├── index.md
│ ├── personal.md
│ ├── resource.md
│ ├── resources/
│ │ ├── bib.md
│ │ ├── dims_types.md
│ │ ├── faq.md
│ │ ├── glossary.md
│ │ ├── overview.md
│ │ └── uses.md
│ └── tutorials/
│ ├── BUILD
│ ├── __init__.py
│ ├── deep_cnn/
│ │ ├── cifar_tensorboard.html
│ │ └── index.md
│ ├── deep_cnn.md
│ ├── mandelbrot/
│ │ └── index.md
│ ├── mandelbrot.md
│ ├── mnist/
│ │ ├── __init__.py
│ │ ├── beginners/
│ │ │ └── index.md
│ │ ├── download/
│ │ │ └── index.md
│ │ ├── fully_connected_feed.py
│ │ ├── input_data.py
│ │ ├── mnist.py
│ │ ├── mnist_softmax.py
│ │ ├── pros/
│ │ │ └── index.md
│ │ └── tf/
│ │ └── index.md
│ ├── mnist_beginners.md
│ ├── mnist_download.md
│ ├── mnist_pros.md
│ ├── mnist_tf.md
│ ├── overview.md
│ ├── pdes/
│ │ └── index.md
│ ├── pdes.md
│ ├── recurrent/
│ │ └── index.md
│ ├── recurrent.md
│ ├── seq2seq/
│ │ └── index.md
│ ├── seq2seq.md
│ ├── word2vec/
│ │ ├── __init__.py
│ │ ├── index.md
│ │ └── word2vec_basic.py
│ └── word2vec.md
├── TOC.md
├── config.json
├── learn-github.md
├── markdown.md
└── tex_pdf/
├── api/
│ ├── c4s00.tex
│ ├── cc/
│ │ ├── ClassEnv.md
│ │ ├── ClassEnvWrapper.md
│ │ ├── ClassRandomAccessFile.md
│ │ ├── ClassSession.md
│ │ ├── ClassStatus.md
│ │ ├── ClassTensor.md
│ │ ├── ClassTensorBuffer.md
│ │ ├── ClassTensorShape.md
│ │ ├── ClassTensorShapeIter.md
│ │ ├── ClassTensorShapeUtils.md
│ │ ├── ClassThread.md
│ │ ├── ClassWritableFile.md
│ │ ├── StructSessionOptions.md
│ │ ├── StructState.md
│ │ ├── StructTensorShapeDim.md
│ │ ├── StructThreadOptions.md
│ │ └── index.md
│ └── python/
│ ├── c4s01_framework.tex
│ ├── c4s02_constant_op.tex
│ ├── c4s03_state_ops.tex
│ ├── c4s04_array_ops.tex
│ ├── c4s05_math_ops.tex
│ ├── c4s06_control_flow_ops.tex
│ ├── c4s07_image.tex
│ ├── c4s08_sparse_ops.tex
│ ├── c4s09_io_ops.tex
│ ├── c4s10_python_io.tex
│ ├── c4s11_nn.tex
│ ├── c4s12_client.tex
│ ├── c4s13_train.tex
│ └── index.tex
├── get_started/
│ ├── c1s01_introduction.tex
│ ├── c1s02_os_setup.tex
│ └── c1s03_basic_usage.tex
├── how_tos/
│ ├── c3s00_overview.tex
│ ├── c3s01_variables.tex
│ ├── c3s02_variable_scope.tex
│ ├── c3s03_viz_learning.tex
│ ├── c3s04_graph_viz.tex
│ ├── c3s05_reading_data.tex
│ ├── c3s06_threading_and_queues.tex
│ ├── c3s07_adding_an_op.tex
│ ├── c3s08_new_data_formats.tex
│ └── c3s09_using_gpu.tex
├── tensorflow_manual_cn.idx
├── tensorflow_manual_cn.ilg
├── tensorflow_manual_cn.ind
├── tensorflow_manual_cn.tex
└── tutorials/
├── c2s00_overview.tex
├── c2s01_minist_beginners.tex
├── c2s02_minist_pros.tex
├── c2s03_.tex
├── c2s04_.tex
├── c2s05_word2vec.tex
├── c2s06_recurrent.tex
├── c2s07_seq2seq.tex
├── c2s08_2_9_mandelbrot.tex
├── c2s09_pdes.tex
└── c2s10_mnist_download.tex
SYMBOL INDEX (62 symbols across 17 files)
FILE: SOURCE/how_tos/adding_an_op/attr_examples.cc
function main (line 27) | int main(int argc, char* argv[]) {
FILE: SOURCE/how_tos/adding_an_op/fact_test.py
class FactTest (line 9) | class FactTest(tf.test.TestCase):
method test (line 11) | def test(self):
FILE: SOURCE/how_tos/adding_an_op/zero_out_1_test.py
class ZeroOut1Test (line 9) | class ZeroOut1Test(tf.test.TestCase):
method test (line 11) | def test(self):
FILE: SOURCE/how_tos/adding_an_op/zero_out_2_test.py
class ZeroOut2Test (line 11) | class ZeroOut2Test(tf.test.TestCase):
method test (line 13) | def test(self):
method test_grad (line 18) | def test_grad(self):
FILE: SOURCE/how_tos/adding_an_op/zero_out_3_test.py
class ZeroOut3Test (line 9) | class ZeroOut3Test(tf.test.TestCase):
method test (line 11) | def test(self):
method testAttr (line 16) | def testAttr(self):
method testNegative (line 21) | def testNegative(self):
method testLarge (line 27) | def testLarge(self):
FILE: SOURCE/how_tos/adding_an_op/zero_out_grad_2.py
function _zero_out_grad (line 9) | def _zero_out_grad(op, grad):
FILE: SOURCE/how_tos/adding_an_op/zero_out_op_kernel_1.cc
class ZeroOutOp (line 16) | class ZeroOutOp : public OpKernel {
method ZeroOutOp (line 18) | explicit ZeroOutOp(OpKernelConstruction* context) : OpKernel(context) {}
method Compute (line 20) | void Compute(OpKernelContext* context) override {
FILE: SOURCE/how_tos/adding_an_op/zero_out_op_kernel_2.cc
class ZeroOutOp (line 40) | class ZeroOutOp : public OpKernel {
method ZeroOutOp (line 42) | explicit ZeroOutOp(OpKernelConstruction* context) : OpKernel(context) {}
method Compute (line 44) | void Compute(OpKernelContext* context) override {
FILE: SOURCE/how_tos/adding_an_op/zero_out_op_kernel_3.cc
class ZeroOutOp (line 11) | class ZeroOutOp : public OpKernel {
method ZeroOutOp (line 13) | explicit ZeroOutOp(OpKernelConstruction* context) : OpKernel(context) {
method Compute (line 23) | void Compute(OpKernelContext* context) override {
FILE: SOURCE/how_tos/reading_data/convert_to_records.py
function _int64_feature (line 27) | def _int64_feature(value):
function _bytes_feature (line 31) | def _bytes_feature(value):
function convert_to (line 35) | def convert_to(images, labels, name):
function main (line 58) | def main(argv):
FILE: SOURCE/how_tos/reading_data/fully_connected_preloaded.py
function run_training (line 34) | def run_training():
function main (line 128) | def main(_):
FILE: SOURCE/how_tos/reading_data/fully_connected_preloaded_var.py
function run_training (line 34) | def run_training():
function main (line 140) | def main(_):
FILE: SOURCE/how_tos/reading_data/fully_connected_reader.py
function read_and_decode (line 38) | def read_and_decode(filename_queue):
function inputs (line 67) | def inputs(train, batch_size, num_epochs):
function run_training (line 109) | def run_training():
function main (line 174) | def main(_):
FILE: SOURCE/tutorials/mnist/fully_connected_feed.py
function placeholder_inputs (line 37) | def placeholder_inputs(batch_size):
function fill_feed_dict (line 59) | def fill_feed_dict(data_set, images_pl, labels_pl):
function do_eval (line 87) | def do_eval(sess,
function run_training (line 116) | def run_training():
function main (line 213) | def main(_):
FILE: SOURCE/tutorials/mnist/input_data.py
function maybe_download (line 12) | def maybe_download(filename, work_directory):
function _read32 (line 24) | def _read32(bytestream):
function extract_images (line 29) | def extract_images(filename):
function dense_to_one_hot (line 47) | def dense_to_one_hot(labels_dense, num_classes=10):
function extract_labels (line 56) | def extract_labels(filename, one_hot=False):
class DataSet (line 73) | class DataSet(object):
method __init__ (line 75) | def __init__(self, images, labels, fake_data=False):
method images (line 98) | def images(self):
method labels (line 102) | def labels(self):
method num_examples (line 106) | def num_examples(self):
method epochs_completed (line 110) | def epochs_completed(self):
method next_batch (line 113) | def next_batch(self, batch_size, fake_data=False):
function read_data_sets (line 138) | def read_data_sets(train_dir, fake_data=False, one_hot=False):
FILE: SOURCE/tutorials/mnist/mnist.py
function inference (line 33) | def inference(images, hidden1_units, hidden2_units):
function loss (line 74) | def loss(logits, labels):
function training (line 101) | def training(loss, learning_rate):
function evaluation (line 130) | def evaluation(logits, labels):
FILE: SOURCE/tutorials/word2vec/word2vec_basic.py
function maybe_download (line 16) | def maybe_download(filename, expected_bytes):
function read_data (line 33) | def read_data(filename):
function build_dataset (line 45) | def build_dataset(words):
function generate_batch (line 73) | def generate_batch(batch_size, num_skips, skip_window):
function plot_with_labels (line 197) | def plot_with_labels(low_dim_embs, labels, filename='tsne.png'):
Condensed preview — 181 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (2,505K chars).
[
{
"path": ".gitignore",
"chars": 122,
"preview": "*.aux\r\n*.fdb_latexmk\r\n*.log\r\n*.out\r\n*.synctex.gz\r\n*.toc\r\n*.fls\r\n*.sublime-project\r\n*.sublime-workspace\r\n*.DS_Store\r\n*.id"
},
{
"path": "README.md",
"chars": 4113,
"preview": "# TensorFlow 官方文档中文版\r\n\r\n \r\n\r\n### 你正在阅读的项目可能会比 Android 系统更加深远地影响着世界! \r\n\r\n## 缘起 \r\n\r\n2"
},
{
"path": "README副本.md",
"chars": 7737,
"preview": "# TensorFlow 官方文档中文版\r\n\r\n\r\n\r\n### 你正在翻译的项目可能会比 Android 系统更加深远地影响着世界!\r\n\r\n## 缘起 \r\n\r\n20"
},
{
"path": "SOURCE/api_docs/cc/ClassEnv.md",
"chars": 8214,
"preview": "# Class `tensorflow::Env` <a class=\"md-anchor\" id=\"AUTOGENERATED-class--tensorflow--env-\"></a>\r\n\r\nAn interface used by t"
},
{
"path": "SOURCE/api_docs/cc/ClassEnvWrapper.md",
"chars": 8054,
"preview": "# Class `tensorflow::EnvWrapper` <a class=\"md-anchor\" id=\"AUTOGENERATED-class--tensorflow--envwrapper-\"></a>\r\n\r\nAn imple"
},
{
"path": "SOURCE/api_docs/cc/ClassRandomAccessFile.md",
"chars": 1935,
"preview": "# Class `tensorflow::RandomAccessFile` <a class=\"md-anchor\" id=\"AUTOGENERATED-class--tensorflow--randomaccessfile-\"></a>"
},
{
"path": "SOURCE/api_docs/cc/ClassSession.md",
"chars": 5063,
"preview": "# Class `tensorflow::Session` <a class=\"md-anchor\" id=\"AUTOGENERATED-class--tensorflow--session-\"></a>\r\n\r\nA Session inst"
},
{
"path": "SOURCE/api_docs/cc/ClassStatus.md",
"chars": 4306,
"preview": "# Class `tensorflow::Status` <a class=\"md-anchor\" id=\"AUTOGENERATED-class--tensorflow--status-\"></a>\r\n\r\n\r\n\r\n\r\n\r\n##Member"
},
{
"path": "SOURCE/api_docs/cc/ClassTensor.md",
"chars": 18503,
"preview": "# Class `tensorflow::Tensor` <a class=\"md-anchor\" id=\"AUTOGENERATED-class--tensorflow--tensor-\"></a>\r\n\r\nRepresents an n-"
},
{
"path": "SOURCE/api_docs/cc/ClassTensorBuffer.md",
"chars": 1928,
"preview": "# Class `tensorflow::TensorBuffer` <a class=\"md-anchor\" id=\"AUTOGENERATED-class--tensorflow--tensorbuffer-\"></a>\r\n\r\n\r\n\r\n"
},
{
"path": "SOURCE/api_docs/cc/ClassTensorShape.md",
"chars": 8952,
"preview": "# Class `tensorflow::TensorShape` <a class=\"md-anchor\" id=\"AUTOGENERATED-class--tensorflow--tensorshape-\"></a>\r\n\r\nManage"
},
{
"path": "SOURCE/api_docs/cc/ClassTensorShapeIter.md",
"chars": 1676,
"preview": "# Class `tensorflow::TensorShapeIter` <a class=\"md-anchor\" id=\"AUTOGENERATED-class--tensorflow--tensorshapeiter-\"></a>\r\n"
},
{
"path": "SOURCE/api_docs/cc/ClassTensorShapeUtils.md",
"chars": 3941,
"preview": "# Class `tensorflow::TensorShapeUtils` <a class=\"md-anchor\" id=\"AUTOGENERATED-class--tensorflow--tensorshapeutils-\"></a>"
},
{
"path": "SOURCE/api_docs/cc/ClassThread.md",
"chars": 742,
"preview": "# Class `tensorflow::Thread` <a class=\"md-anchor\" id=\"AUTOGENERATED-class--tensorflow--thread-\"></a>\r\n\r\n\r\n\r\n\r\n\r\n##Member"
},
{
"path": "SOURCE/api_docs/cc/ClassWritableFile.md",
"chars": 1939,
"preview": "# Class `tensorflow::WritableFile` <a class=\"md-anchor\" id=\"AUTOGENERATED-class--tensorflow--writablefile-\"></a>\r\n\r\nA fi"
},
{
"path": "SOURCE/api_docs/cc/StructSessionOptions.md",
"chars": 2220,
"preview": "# Struct `tensorflow::SessionOptions` <a class=\"md-anchor\" id=\"AUTOGENERATED-struct--tensorflow--sessionoptions-\"></a>\r\n"
},
{
"path": "SOURCE/api_docs/cc/StructState.md",
"chars": 764,
"preview": "# Struct `tensorflow::Status::State` <a class=\"md-anchor\" id=\"AUTOGENERATED-struct--tensorflow--status--state-\"></a>\r\n\r\n"
},
{
"path": "SOURCE/api_docs/cc/StructTensorShapeDim.md",
"chars": 736,
"preview": "# Struct `tensorflow::TensorShapeDim` <a class=\"md-anchor\" id=\"AUTOGENERATED-struct--tensorflow--tensorshapedim-\"></a>\r\n"
},
{
"path": "SOURCE/api_docs/cc/StructThreadOptions.md",
"chars": 1084,
"preview": "# Struct `tensorflow::ThreadOptions` <a class=\"md-anchor\" id=\"AUTOGENERATED-struct--tensorflow--threadoptions-\"></a>\r\n\r\n"
},
{
"path": "SOURCE/api_docs/cc/index.md",
"chars": 2821,
"preview": "# TensorFlow C++ Session API reference documentation <a class=\"md-anchor\" id=\"AUTOGENERATED-tensorflow-c---session-api-r"
},
{
"path": "SOURCE/api_docs/index.md",
"chars": 835,
"preview": "# Overview <a class=\"md-anchor\" id=\"AUTOGENERATED-overview\"></a>\r\n\r\nTensorFlow has APIs available in several languages b"
},
{
"path": "SOURCE/api_docs/python/array_ops.md",
"chars": 32985,
"preview": "<!-- This file is machine generated: DO NOT EDIT! -->\r\n\r\n# Tensor Transformations <a class=\"md-anchor\" id=\"AUTOGENERATED"
},
{
"path": "SOURCE/api_docs/python/client.md",
"chars": 23267,
"preview": "<!-- This file is machine generated: DO NOT EDIT! -->\r\n\r\n# Running Graphs <a class=\"md-anchor\" id=\"AUTOGENERATED-running"
},
{
"path": "SOURCE/api_docs/python/constant_op.md",
"chars": 19641,
"preview": "<!-- This file is machine generated: DO NOT EDIT! -->\r\n\r\n# Constants, Sequences, and Random Values <a class=\"md-anchor\" "
},
{
"path": "SOURCE/api_docs/python/control_flow_ops.md",
"chars": 19047,
"preview": "<!-- This file is machine generated: DO NOT EDIT! -->\r\n\r\n# Control Flow <a class=\"md-anchor\" id=\"AUTOGENERATED-control-f"
},
{
"path": "SOURCE/api_docs/python/framework.md",
"chars": 67453,
"preview": "<!-- This file is machine generated: DO NOT EDIT! -->\r\n\r\n# Building Graphs <a class=\"md-anchor\" id=\"AUTOGENERATED-buildi"
},
{
"path": "SOURCE/api_docs/python/image.md",
"chars": 33430,
"preview": "<!-- This file is machine generated: DO NOT EDIT! -->\r\n\r\n# Images <a class=\"md-anchor\" id=\"AUTOGENERATED-images\"></a>\r\n\r"
},
{
"path": "SOURCE/api_docs/python/index.md",
"chars": 23734,
"preview": "<!-- This file is machine generated: DO NOT EDIT! -->\r\n\r\n# TensorFlow Python reference documentation <a class=\"md-anchor"
},
{
"path": "SOURCE/api_docs/python/io_ops.md",
"chars": 67777,
"preview": "<!-- This file is machine generated: DO NOT EDIT! -->\r\n\r\n# Inputs and Readers <a class=\"md-anchor\" id=\"AUTOGENERATED-inp"
},
{
"path": "SOURCE/api_docs/python/math_ops.md",
"chars": 63177,
"preview": "<!-- This file is machine generated: DO NOT EDIT! -->\r\n\r\n# Math <a class=\"md-anchor\" id=\"AUTOGENERATED-math\"></a>\r\n\r\nNot"
},
{
"path": "SOURCE/api_docs/python/nn.md",
"chars": 54178,
"preview": "<!-- This file is machine generated: DO NOT EDIT! -->\r\n\r\n# Neural Network <a class=\"md-anchor\" id=\"AUTOGENERATED-neural-"
},
{
"path": "SOURCE/api_docs/python/python_io.md",
"chars": 3179,
"preview": "<!-- This file is machine generated: DO NOT EDIT! -->\r\n\r\n# Data IO (Python functions) <a class=\"md-anchor\" id=\"AUTOGENER"
},
{
"path": "SOURCE/api_docs/python/sparse_ops.md",
"chars": 16346,
"preview": "<!-- This file is machine generated: DO NOT EDIT! -->\r\n\r\n# Sparse Tensors <a class=\"md-anchor\" id=\"AUTOGENERATED-sparse-"
},
{
"path": "SOURCE/api_docs/python/state_ops.md",
"chars": 50115,
"preview": "<!-- This file is machine generated: DO NOT EDIT! -->\r\n\r\n# Variables <a class=\"md-anchor\" id=\"AUTOGENERATED-variables\"><"
},
{
"path": "SOURCE/api_docs/python/train.md",
"chars": 68066,
"preview": "<!-- This file is machine generated: DO NOT EDIT! -->\r\n\r\n# Training <a class=\"md-anchor\" id=\"AUTOGENERATED-training\"></a"
},
{
"path": "SOURCE/extras/README.txt",
"chars": 104,
"preview": "This directory holds extra files we'd like to be able\r\nto link to and serve from within tensorflow.org\r\n"
},
{
"path": "SOURCE/faq.md",
"chars": 820,
"preview": "# 常见问题汇总\r\n\r\n## 说明\r\n\r\n本章非官方文档翻译,是由众多TensorFlow爱好者将安装和使用TF过程中的问题总结而成的。\r\n\r\n## 常见问题及解答\r\n\r\n### (示例)官网地址是哪里?\r\n\r\n[http://www.te"
},
{
"path": "SOURCE/get_started/basic_usage.md",
"chars": 7460,
"preview": "# 基本使用 <a class=\"md-anchor\" id=\"AUTOGENERATED-basic-usage\"></a>\r\n\r\n使用 TensorFlow, 你必须明白 TensorFlow:\r\n\r\n* 使用图 (graph) 来表示"
},
{
"path": "SOURCE/get_started/introduction.md",
"chars": 2527,
"preview": "# 简介 <a class=\"md-anchor\" id=\"AUTOGENERATED-introduction\"></a>\r\n\r\n本章的目的是让你了解和运行 TensorFlow!\r\n\r\n在开始之前, 让我们先看一段使用 Python A"
},
{
"path": "SOURCE/get_started/os_setup.md",
"chars": 15127,
"preview": "# 下载与安装 <a class=\"md-anchor\" id=\"AUTOGENERATED-download-and-setup\"></a>\n\n你可以使用我们提供的 Pip, Docker, Virtualenv, Anaconda 或 "
},
{
"path": "SOURCE/how_tos/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "SOURCE/how_tos/adding_an_op/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "SOURCE/how_tos/adding_an_op/attr_examples.cc",
"chars": 1000,
"preview": "#include <stdio.h>\r\n#include \"tensorflow/core/framework/op.h\"\r\n\r\nREGISTER_OP(\"RestrictedTypeExample\").Attr(\"t: {int32, f"
},
{
"path": "SOURCE/how_tos/adding_an_op/fact_test.py",
"chars": 338,
"preview": "\"\"\"Test that user ops can be used as expected.\"\"\"\r\nfrom __future__ import print_function\r\n\r\nimport tensorflow.python.pla"
},
{
"path": "SOURCE/how_tos/adding_an_op/index.md",
"chars": 42947,
"preview": "# Adding a New Op <a class=\"md-anchor\" id=\"AUTOGENERATED-adding-a-new-op\"></a>\r\n\r\nPREREQUISITES:\r\n\r\n* Some familiarity w"
},
{
"path": "SOURCE/how_tos/adding_an_op/zero_out_1_test.py",
"chars": 443,
"preview": "\"\"\"Test for version 1 of the zero_out op.\"\"\"\r\n\r\nimport tensorflow.python.platform\r\n\r\nimport tensorflow as tf\r\nfrom tenso"
},
{
"path": "SOURCE/how_tos/adding_an_op/zero_out_2_test.py",
"chars": 852,
"preview": "\"\"\"Test for version 2 of the zero_out op.\"\"\"\r\n\r\nimport tensorflow.python.platform\r\n\r\nimport tensorflow as tf\r\nfrom tenso"
},
{
"path": "SOURCE/how_tos/adding_an_op/zero_out_3_test.py",
"chars": 1100,
"preview": "\"\"\"Test for version 3 of the zero_out op.\"\"\"\r\n\r\nimport tensorflow.python.platform\r\n\r\nimport tensorflow as tf\r\nfrom tenso"
},
{
"path": "SOURCE/how_tos/adding_an_op/zero_out_grad_2.py",
"chars": 885,
"preview": "\"\"\"The gradient of the tutorial zero_out op.\"\"\"\r\n\r\nfrom tensorflow.python.framework import ops\r\nfrom tensorflow.python.o"
},
{
"path": "SOURCE/how_tos/adding_an_op/zero_out_op_kernel_1.cc",
"chars": 1284,
"preview": "#include \"tensorflow/core/framework/op.h\"\r\n#include \"tensorflow/core/framework/op_kernel.h\"\r\n\r\nusing namespace tensorflo"
},
{
"path": "SOURCE/how_tos/adding_an_op/zero_out_op_kernel_2.cc",
"chars": 2982,
"preview": "#include \"tensorflow/core/framework/op_kernel.h\"\r\n#include \"tensorflow/core/framework/register_types.h\"\r\n\r\nusing namespa"
},
{
"path": "SOURCE/how_tos/adding_an_op/zero_out_op_kernel_3.cc",
"chars": 1782,
"preview": "#include \"tensorflow/core/framework/op.h\"\r\n#include \"tensorflow/core/framework/op_kernel.h\"\r\n\r\nusing namespace tensorflo"
},
{
"path": "SOURCE/how_tos/adding_an_op.md",
"chars": 30437,
"preview": "# 增加一个新 Op <a class=\"md-anchor\" id=\"AUTOGENERATED-adding-a-new-op\"></a>\r\n\r\n预备知识:\r\n\r\n* 对 C++ 有一定了解.\r\n* 已经[下载 TensorFlow 源"
},
{
"path": "SOURCE/how_tos/graph_viz/index.md",
"chars": 10710,
"preview": "# TensorBoard: Graph Visualization <a class=\"md-anchor\" id=\"AUTOGENERATED-tensorboard--graph-visualization\"></a>\r\n\r\nTens"
},
{
"path": "SOURCE/how_tos/graph_viz.md",
"chars": 5967,
"preview": "# TensorBoard: 图表可视化 <a class=\"md-anchor\" id=\"AUTOGENERATED-tensorboard--graph-visualization\"></a>\r\n\r\nTensorFlow 图表计算强大而"
},
{
"path": "SOURCE/how_tos/new_data_formats/Custom Data Readers.md",
"chars": 8056,
"preview": "# 自定义数据读取 <a class=\"md-anchor\" id=\"AUTOGENERATED-custom-data-readers\"></a>\r\n\r\n基本要求:\r\n\r\n* 熟悉 C++ 编程。\r\n* 确保\r\n [下载 T"
},
{
"path": "SOURCE/how_tos/new_data_formats/index.md",
"chars": 10640,
"preview": "# Custom Data Readers <a class=\"md-anchor\" id=\"AUTOGENERATED-custom-data-readers\"></a>\r\n\r\nPREREQUISITES:\r\n\r\n* Some fam"
},
{
"path": "SOURCE/how_tos/new_data_formats.md",
"chars": 8288,
"preview": "# 自定义数据读取 <a class=\"md-anchor\" id=\"AUTOGENERATED-custom-data-readers\"></a>\r\n\r\n基本要求:\r\n\r\n* 熟悉 C++ 编程。\r\n* 确保[下载 TensorFlow "
},
{
"path": "SOURCE/how_tos/overview.md",
"chars": 2058,
"preview": "# 综述 Overview\r\n\r\n## Variables: 创建,初始化,保存,和恢复\r\n\r\nTensorFlow Variables 是内存中的容纳 tensor 的缓存。这一小节介绍了用它们在模型训练时(during training"
},
{
"path": "SOURCE/how_tos/reading_data/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "SOURCE/how_tos/reading_data/convert_to_records.py",
"chars": 3219,
"preview": "\"\"\"Converts MNIST data to TFRecords file format with Example protos.\"\"\"\r\nfrom __future__ import print_function\r\n\r\nimport"
},
{
"path": "SOURCE/how_tos/reading_data/fully_connected_preloaded.py",
"chars": 4627,
"preview": "\"\"\"Trains the MNIST network using preloaded data in a constant.\r\n\r\nCommand to run this py_binary target:\r\n\r\nbazel run -c"
},
{
"path": "SOURCE/how_tos/reading_data/fully_connected_preloaded_var.py",
"chars": 5216,
"preview": "\"\"\"Trains the MNIST network using preloaded data stored in a variable.\r\n\r\nCommand to run this py_binary target:\r\n\r\nbazel"
},
{
"path": "SOURCE/how_tos/reading_data/fully_connected_reader.py",
"chars": 6297,
"preview": "\"\"\"Train and Eval the MNIST network.\r\n\r\nThis version is like fully_connected_feed.py but uses data converted\r\nto a TFRec"
},
{
"path": "SOURCE/how_tos/reading_data/index.md",
"chars": 24886,
"preview": "# Reading data <a class=\"md-anchor\" id=\"AUTOGENERATED-reading-data\"></a>\r\n\r\nThere are three main methods of getting data"
},
{
"path": "SOURCE/how_tos/reading_data.md",
"chars": 17028,
"preview": "# 数据读取 <a class=\"md-anchor\" id=\"AUTOGENERATED-reading-data\"></a>\r\n\r\nTensorFlow程序读取数据一共有3种方法:\r\n\r\n* 供给数据(Feeding): 在Tens"
},
{
"path": "SOURCE/how_tos/summaries_and_tensorboard/index.md",
"chars": 5345,
"preview": "# TensorBoard: Visualizing Learning <a class=\"md-anchor\" id=\"AUTOGENERATED-tensorboard--visualizing-learning\"></a>\r\n\r\nTh"
},
{
"path": "SOURCE/how_tos/summaries_and_tensorboard.md",
"chars": 3118,
"preview": "# TensorBoard:可视化学习 <a class=\"md-anchor\" id=\"AUTOGENERATED-tensorboard--visualizing-learning\"></a>\r\n\r\nTensorBoard 涉及到的运算"
},
{
"path": "SOURCE/how_tos/threading_and_queues/index.md",
"chars": 7405,
"preview": "# Threading and Queues <a class=\"md-anchor\" id=\"AUTOGENERATED-threading-and-queues\"></a>\r\n\r\nQueues are a powerful mechan"
},
{
"path": "SOURCE/how_tos/threading_and_queues.md",
"chars": 4981,
"preview": "# 线程和队列 <a class=\"md-anchor\" id=\"AUTOGENERATED-threading-and-queues\"></a>\r\n\r\n在使用TensorFlow进行异步计算时,队列是一种强大的机制。\r\n\r\n正如Tenso"
},
{
"path": "SOURCE/how_tos/using_gpu/index.md",
"chars": 6367,
"preview": "# Using GPUs <a class=\"md-anchor\" id=\"AUTOGENERATED-using-gpus\"></a>\r\n\r\n## Supported devices <a class=\"md-anchor\" id=\"AU"
},
{
"path": "SOURCE/how_tos/using_gpu.md",
"chars": 5323,
"preview": "# 使用 GPUs <a class=\"md-anchor\" id=\"AUTOGENERATED-using-gpus\"></a>\r\n\r\n## 支持的设备 <a class=\"md-anchor\" id=\"AUTOGENERATED-sup"
},
{
"path": "SOURCE/how_tos/variable_scope/index.md",
"chars": 10934,
"preview": "# 共享变量<a class=\"md-anchor\" id=\"AUTOGENERATED-sharing-variables\"></a>\r\n你可以在[怎么使用变量](../../how_tos/variables/index.md)中所描述"
},
{
"path": "SOURCE/how_tos/variable_scope.md",
"chars": 11048,
"preview": "# 共享变量<a class=\"md-anchor\" id=\"AUTOGENERATED-sharing-variables\"></a>\r\n\r\n你可以在[怎么使用变量](tensorflow-zh/SOURCE/how_tos/variab"
},
{
"path": "SOURCE/how_tos/variables/index.md",
"chars": 8830,
"preview": "# Variables: Creation, Initialization, Saving, and Loading <a class=\"md-anchor\" id=\"AUTOGENERATED-variables--creation--i"
},
{
"path": "SOURCE/how_tos/variables.md",
"chars": 5463,
"preview": "# 变量:创建、初始化、保存和加载#\r\n\r\n当训练模型时,用[变量](https://github.com/jikexueyuanwiki/tensorflow-zh/blob/master/api_docs/python/state_op"
},
{
"path": "SOURCE/images/getting_started.dot",
"chars": 508,
"preview": "digraph Dependencies {\r\n node [shape = oval];\r\n \"predictions: MatMul()\" -> \"data: Concat()\"\r\n \"data: Concat()\" -> dat"
},
{
"path": "SOURCE/index.md",
"chars": 1192,
"preview": "# TensorFlow <a class=\"md-anchor\" id=\"AUTOGENERATED-tensorflow\"></a>\r\n\r\n<!-- Note: This file is ignored in building the "
},
{
"path": "SOURCE/personal.md",
"chars": 142,
"preview": "## TensorFlow 个人学习心得\r\n\r\n说明:本章所列链接为个人学习TensorFlow的心得,很多是博客地址,从实践的角度帮助大家更好的理解官方文档的内容\r\n\r\n示例:\r\n\r\n- [我的TensorFlow学习博客](http:/"
},
{
"path": "SOURCE/resource.md",
"chars": 692,
"preview": "## TensorFlow 相关资源\r\n\r\n- [Google官方Blog宣布TensorFlow开源](https://googleblog.blogspot.com/2015/11/tensorflow-smarter-machine-"
},
{
"path": "SOURCE/resources/bib.md",
"chars": 2177,
"preview": "# BibTex 引用<a class=\"md-anchor\" id=\"AUTOGENERATED-bibtex-citation\"></a>\r\n\r\n如果你在研究中使用了 TensorFlow,并且希望引用 TensorFlow系统。我们建"
},
{
"path": "SOURCE/resources/dims_types.md",
"chars": 2180,
"preview": "# 张量的阶、形状、数据类型<a class=\"md-anchor\" id=\"AUTOGENERATED-tensor-ranks--shapes--and-types\"></a>\r\n\r\nTensorFlow用张量这种数据结构来表示所有的数"
},
{
"path": "SOURCE/resources/faq.md",
"chars": 13043,
"preview": "# 常见问题 <a class=\"md-anchor\" id=\"AUTOGENERATED-frequently-asked-questions\"></a>\r\n\r\n此文档对关于TensorFlow的一些常见问题提供了答案,如果这里没有你问题"
},
{
"path": "SOURCE/resources/glossary.md",
"chars": 4130,
"preview": "# 术语表\r\n\r\n### 广播操作(Broadcasting operation)\r\n\r\n一种用[numpy-style broadcasting](http://docs.scipy.org/doc/numpy/user/basics.b"
},
{
"path": "SOURCE/resources/overview.md",
"chars": 1582,
"preview": "# 其他资源 <a class=\"md-anchor\" id=\"AUTOGENERATED-additional-resources\"></a>\r\n\r\n## TensorFlow 白皮书 <a class=\"md-anchor\" id=\"A"
},
{
"path": "SOURCE/resources/uses.md",
"chars": 1632,
"preview": "# 应用实例 <a class=\"md-anchor\" id=\"AUTOGENERATED-example-uses\"></a>\r\n\r\n本页介绍了一些 TensorFlow 系统当前在实际中的应用。\r\n\r\n> 如果您在做研究、教育、或在某些"
},
{
"path": "SOURCE/tutorials/BUILD",
"chars": 346,
"preview": "# Description:\r\n# Top-level tutorials files\r\n\r\npackage(default_visibility = [\"//tensorflow:internal\"])\r\n\r\nlicenses([\"not"
},
{
"path": "SOURCE/tutorials/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "SOURCE/tutorials/deep_cnn/cifar_tensorboard.html",
"chars": 449,
"preview": "<html>\r\n\r\n<head>\r\n <title>TensorBoard Demo</title>\r\n <script src=\"/tensorboard/webcomponents-lite.min.js\"></script>\r\n "
},
{
"path": "SOURCE/tutorials/deep_cnn/index.md",
"chars": 23231,
"preview": "# Convolutional Neural Networks <a class=\"md-anchor\" id=\"AUTOGENERATED-convolutional-neural-networks\"></a>\r\n\r\n> **NOTE:*"
},
{
"path": "SOURCE/tutorials/deep_cnn.md",
"chars": 17008,
"preview": "# 卷积神经网络 <a class=\"md-anchor\" id=\"AUTOGENERATED-convolutional-neural-networks\"></a>\r\n\r\n> **注意:** 本教程适用于对Tensorflow有丰富经验的"
},
{
"path": "SOURCE/tutorials/mandelbrot/index.md",
"chars": 3191,
"preview": "# Mandelbrot Set <a class=\"md-anchor\" id=\"AUTOGENERATED-mandelbrot-set\"></a>\r\n\r\nVisualizing the Mandelbrot set doesn't h"
},
{
"path": "SOURCE/tutorials/mandelbrot.md",
"chars": 2445,
"preview": "# 曼德布洛特(Mandelbrot)集合 <a class=\"md-anchor\" id=\"AUTOGENERATED-mandelbrot-set\"></a>\r\n\r\n虽然可视化曼德布洛特(Mandelbrot)集合与机器学习没有任何关系"
},
{
"path": "SOURCE/tutorials/mnist/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "SOURCE/tutorials/mnist/beginners/index.md",
"chars": 18758,
"preview": "# MNIST For ML Beginners <a class=\"md-anchor\" id=\"AUTOGENERATED-mnist-for-ml-beginners\"></a>\r\n\r\n*This tutorial is intend"
},
{
"path": "SOURCE/tutorials/mnist/download/index.md",
"chars": 4425,
"preview": "# MNIST Data Download <a class=\"md-anchor\" id=\"AUTOGENERATED-mnist-data-download\"></a>\r\n\r\nCode: [tensorflow/g3doc/tutori"
},
{
"path": "SOURCE/tutorials/mnist/fully_connected_feed.py",
"chars": 8247,
"preview": "\"\"\"Trains and Evaluates the MNIST network using a feed dictionary.\r\n\r\nTensorFlow install instructions:\r\nhttps://tensorfl"
},
{
"path": "SOURCE/tutorials/mnist/input_data.py",
"chars": 5918,
"preview": "\"\"\"Functions for downloading and reading MNIST data.\"\"\"\r\nfrom __future__ import print_function\r\nimport gzip\r\nimport os\r\n"
},
{
"path": "SOURCE/tutorials/mnist/mnist.py",
"chars": 5708,
"preview": "\"\"\"Builds the MNIST network.\r\n\r\nImplements the inference/loss/training pattern for model building.\r\n\r\n1. inference() - B"
},
{
"path": "SOURCE/tutorials/mnist/mnist_softmax.py",
"chars": 1191,
"preview": "\"\"\"A very simple MNIST classifer.\r\n\r\nSee extensive documentation at ??????? (insert public URL)\r\n\"\"\"\r\nfrom __future__ im"
},
{
"path": "SOURCE/tutorials/mnist/pros/index.md",
"chars": 16461,
"preview": "# Deep MNIST for Experts <a class=\"md-anchor\" id=\"AUTOGENERATED-deep-mnist-for-experts\"></a>\r\n\r\nTensorFlow is a powerfu"
},
{
"path": "SOURCE/tutorials/mnist/tf/index.md",
"chars": 20630,
"preview": "\r\n# TensorFlow Mechanics 101 <a class=\"md-anchor\" id=\"AUTOGENERATED-tensorflow-mechanics-101\"></a>\r\n\r\nCode: [tensorflow/"
},
{
"path": "SOURCE/tutorials/mnist_beginners.md",
"chars": 10112,
"preview": "# MNIST机器学习入门 <a class=\"md-anchor\" id=\"AUTOGENERATED-mnist-for-ml-beginners\"></a>\r\n\r\n*这个教程的目标读者是对机器学习和TensorFlow都不太了解的新手"
},
{
"path": "SOURCE/tutorials/mnist_download.md",
"chars": 2943,
"preview": "# MNIST 数据下载 <a class=\"md-anchor\" id=\"AUTOGENERATED-mnist-data-download\"></a>\r\n\r\n源码: [tensorflow/g3doc/tutorials/mnist/]"
},
{
"path": "SOURCE/tutorials/mnist_pros.md",
"chars": 10038,
"preview": "# 深入MNIST <a class=\"md-anchor\" id=\"AUTOGENERATED-deep-mnist-for-experts\"></a>\r\n\r\nTensorFlow是一个非常强大的用来做大规模数值计算的库。其所擅长的任务之"
},
{
"path": "SOURCE/tutorials/mnist_tf.md",
"chars": 13848,
"preview": "# TensorFlow运作方式入门 <a class=\"md-anchor\" id=\"AUTOGENERATED-tensorflow-mechanics-101\"></a>\r\n\r\n代码:[tensorflow/g3doc/tutoria"
},
{
"path": "SOURCE/tutorials/overview.md",
"chars": 2189,
"preview": "# 综述\r\n\r\n## 面向机器学习初学者的 MNIST 初级教程\r\n\r\n如果你是机器学习领域的新手, 我们推荐你从本文开始阅读. 本文通过讲述一个经典的问题, 手写数字识别 (MNIST), 让你对多类分类 (multiclass clas"
},
{
"path": "SOURCE/tutorials/pdes/index.md",
"chars": 3634,
"preview": "# 偏积分方程 <a class=\"md-anchor\" id=\"AUTOGENERATED-partial-differential-equations\"></a>\r\n\r\n ***TensorFlow*** 不仅仅是用来机器学习,它更可以"
},
{
"path": "SOURCE/tutorials/pdes.md",
"chars": 3676,
"preview": "# 偏微分方程 <a class=\"md-anchor\" id=\"AUTOGENERATED-partial-differential-equations\"></a>\r\n\r\n***TensorFlow*** 不仅仅是用来机器学习,它更可以用"
},
{
"path": "SOURCE/tutorials/recurrent/index.md",
"chars": 8164,
"preview": "# Recurrent Neural Networks <a class=\"md-anchor\" id=\"AUTOGENERATED-recurrent-neural-networks\"></a>\r\n\r\n## Introduction <a"
},
{
"path": "SOURCE/tutorials/recurrent.md",
"chars": 5039,
"preview": "# 递归神经网络 <a class=\"md-anchor\" id=\"AUTOGENERATED-recurrent-neural-networks\"></a>\r\n\r\n## 介绍 <a class=\"md-anchor\" id=\"AUTOGE"
},
{
"path": "SOURCE/tutorials/seq2seq/index.md",
"chars": 17377,
"preview": "# Sequence-to-Sequence Models <a class=\"md-anchor\" id=\"AUTOGENERATED-sequence-to-sequence-models\"></a>\r\n\r\nRecurrent neur"
},
{
"path": "SOURCE/tutorials/seq2seq.md",
"chars": 17437,
"preview": "# Sequence-to-Sequence Models <a class=\"md-anchor\" id=\"AUTOGENERATED-sequence-to-sequence-models\"></a>\r\n\r\nRecurrent neur"
},
{
"path": "SOURCE/tutorials/word2vec/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "SOURCE/tutorials/word2vec/index.md",
"chars": 12172,
"preview": "# Vector Representations of Words <a class=\"md-anchor\" id=\"AUTOGENERATED-vector-representations-of-words\"></a>\r\n\r\n\r\n在本教程"
},
{
"path": "SOURCE/tutorials/word2vec/word2vec_basic.py",
"chars": 8087,
"preview": "from __future__ import print_function\r\nimport tensorflow.python.platform\r\n\r\nimport collections\r\nimport math\r\nimport nump"
},
{
"path": "SOURCE/tutorials/word2vec.md",
"chars": 11683,
"preview": "# Vector Representations of Words <a class=\"md-anchor\" id=\"AUTOGENERATED-vector-representations-of-words\"></a>\r\n\r\n在本教程我们"
},
{
"path": "TOC.md",
"chars": 1518,
"preview": "- 起步\r\n - [介绍](SOURCE/get_started/introduction.md)\r\n - [下载及安装](SOURCE/get_started/os_setup.md)\r\n - [基本用法](SOURCE/get_s"
},
{
"path": "config.json",
"chars": 192,
"preview": "{\r\n \"name\": \"TensorFlow 官方文档中文版\",\r\n \"introduction\": \"Google 人工智能系统 TensorFlow 官方文档中文版协同翻译。\",\r\n \"path\": {\r\n "
},
{
"path": "learn-github.md",
"chars": 530,
"preview": "\r\n## 注册 GitHub 账号\r\n\r\n<http://wiki.jikexueyuan.com/project/github-basics/sign-up.html>\r\n\r\n## 创建仓库\r\n\r\n<http://wiki.jikexue"
},
{
"path": "markdown.md",
"chars": 2430,
"preview": "## Markdown 工具下载\r\n\r\n- Windows 用户推荐使用编辑器 MarkdownPad \r\n下载地址:<http://markdownpad.com>\r\n \r\n- Mac 用户推荐使用编辑器 Mou \r\n下载地址:<"
},
{
"path": "tex_pdf/api/c4s00.tex",
"chars": 814,
"preview": "\r\n\r\n\\section{Overview}\\label{api_overview}\r\n\r\nTensorFlow has APIs available in several languages both for constructing\r\n"
},
{
"path": "tex_pdf/api/cc/ClassEnv.md",
"chars": 8214,
"preview": "# Class `tensorflow::Env` <a class=\"md-anchor\" id=\"AUTOGENERATED-class--tensorflow--env-\"></a>\r\n\r\nAn interface used by t"
},
{
"path": "tex_pdf/api/cc/ClassEnvWrapper.md",
"chars": 8054,
"preview": "# Class `tensorflow::EnvWrapper` <a class=\"md-anchor\" id=\"AUTOGENERATED-class--tensorflow--envwrapper-\"></a>\r\n\r\nAn imple"
},
{
"path": "tex_pdf/api/cc/ClassRandomAccessFile.md",
"chars": 1935,
"preview": "# Class `tensorflow::RandomAccessFile` <a class=\"md-anchor\" id=\"AUTOGENERATED-class--tensorflow--randomaccessfile-\"></a>"
},
{
"path": "tex_pdf/api/cc/ClassSession.md",
"chars": 5063,
"preview": "# Class `tensorflow::Session` <a class=\"md-anchor\" id=\"AUTOGENERATED-class--tensorflow--session-\"></a>\r\n\r\nA Session inst"
},
{
"path": "tex_pdf/api/cc/ClassStatus.md",
"chars": 4306,
"preview": "# Class `tensorflow::Status` <a class=\"md-anchor\" id=\"AUTOGENERATED-class--tensorflow--status-\"></a>\r\n\r\n\r\n\r\n\r\n\r\n##Member"
},
{
"path": "tex_pdf/api/cc/ClassTensor.md",
"chars": 18503,
"preview": "# Class `tensorflow::Tensor` <a class=\"md-anchor\" id=\"AUTOGENERATED-class--tensorflow--tensor-\"></a>\r\n\r\nRepresents an n-"
},
{
"path": "tex_pdf/api/cc/ClassTensorBuffer.md",
"chars": 1928,
"preview": "# Class `tensorflow::TensorBuffer` <a class=\"md-anchor\" id=\"AUTOGENERATED-class--tensorflow--tensorbuffer-\"></a>\r\n\r\n\r\n\r\n"
},
{
"path": "tex_pdf/api/cc/ClassTensorShape.md",
"chars": 8952,
"preview": "# Class `tensorflow::TensorShape` <a class=\"md-anchor\" id=\"AUTOGENERATED-class--tensorflow--tensorshape-\"></a>\r\n\r\nManage"
},
{
"path": "tex_pdf/api/cc/ClassTensorShapeIter.md",
"chars": 1676,
"preview": "# Class `tensorflow::TensorShapeIter` <a class=\"md-anchor\" id=\"AUTOGENERATED-class--tensorflow--tensorshapeiter-\"></a>\r\n"
},
{
"path": "tex_pdf/api/cc/ClassTensorShapeUtils.md",
"chars": 3941,
"preview": "# Class `tensorflow::TensorShapeUtils` <a class=\"md-anchor\" id=\"AUTOGENERATED-class--tensorflow--tensorshapeutils-\"></a>"
},
{
"path": "tex_pdf/api/cc/ClassThread.md",
"chars": 742,
"preview": "# Class `tensorflow::Thread` <a class=\"md-anchor\" id=\"AUTOGENERATED-class--tensorflow--thread-\"></a>\r\n\r\n\r\n\r\n\r\n\r\n##Member"
},
{
"path": "tex_pdf/api/cc/ClassWritableFile.md",
"chars": 1939,
"preview": "# Class `tensorflow::WritableFile` <a class=\"md-anchor\" id=\"AUTOGENERATED-class--tensorflow--writablefile-\"></a>\r\n\r\nA fi"
},
{
"path": "tex_pdf/api/cc/StructSessionOptions.md",
"chars": 2220,
"preview": "# Struct `tensorflow::SessionOptions` <a class=\"md-anchor\" id=\"AUTOGENERATED-struct--tensorflow--sessionoptions-\"></a>\r\n"
},
{
"path": "tex_pdf/api/cc/StructState.md",
"chars": 764,
"preview": "# Struct `tensorflow::Status::State` <a class=\"md-anchor\" id=\"AUTOGENERATED-struct--tensorflow--status--state-\"></a>\r\n\r\n"
},
{
"path": "tex_pdf/api/cc/StructTensorShapeDim.md",
"chars": 736,
"preview": "# Struct `tensorflow::TensorShapeDim` <a class=\"md-anchor\" id=\"AUTOGENERATED-struct--tensorflow--tensorshapedim-\"></a>\r\n"
},
{
"path": "tex_pdf/api/cc/StructThreadOptions.md",
"chars": 1084,
"preview": "# Struct `tensorflow::ThreadOptions` <a class=\"md-anchor\" id=\"AUTOGENERATED-struct--tensorflow--threadoptions-\"></a>\r\n\r\n"
},
{
"path": "tex_pdf/api/cc/index.md",
"chars": 2821,
"preview": "# TensorFlow C++ Session API reference documentation <a class=\"md-anchor\" id=\"AUTOGENERATED-tensorflow-c---session-api-r"
},
{
"path": "tex_pdf/api/python/c4s01_framework.tex",
"chars": 93495,
"preview": "\r\n\r\n\r\n\\section{Building Graphs} \\label{building-graphs}\r\n\r\n\\subsection{Contents}\\label{contents}\r\n\r\n\\subsubsection{\\texo"
},
{
"path": "tex_pdf/api/python/c4s02_constant_op.tex",
"chars": 28203,
"preview": "\r\n\\section{Constants, Sequences, and Random Values} \\label{const_seq_rnd}\r\n\r\n\\footnote{Note: Functions taking Tensor arg"
},
{
"path": "tex_pdf/api/python/c4s03_state_ops.tex",
"chars": 67926,
"preview": "\r\n\r\n\\section{Variables }\\label{variables}\r\n\r\nNote: Functions taking \\lstinline{Tensor} arguments can also take anything\r"
},
{
"path": "tex_pdf/api/python/c4s04_array_ops.tex",
"chars": 45227,
"preview": "\r\n\r\n\\section{Tensor Transformations }\\label{tensor-transformations}\r\n\r\nNote: Functions taking \\lstinline{Tensor} argumen"
},
{
"path": "tex_pdf/api/python/c4s05_math_ops.tex",
"chars": 86727,
"preview": "\r\n\r\n\\section{Math }\\label{math}\r\n\r\nNote: Functions taking \\texttt{Tensor} arguments can also take anything\r\naccepted by\r"
},
{
"path": "tex_pdf/api/python/c4s06_control_flow_ops.tex",
"chars": 24640,
"preview": "\r\n\r\n\\section{Control Flow }\\label{control-flow}\r\n\r\nNote: Functions taking \\texttt{Tensor} arguments can also take anythi"
},
{
"path": "tex_pdf/api/python/c4s07_image.tex",
"chars": 42832,
"preview": "\r\n\r\n\r\n\\section{Images }\\label{images}\r\n\r\nNote: Functions taking \\texttt{Tensor} arguments can also take anything\r\naccept"
},
{
"path": "tex_pdf/api/python/c4s08_sparse_ops.tex",
"chars": 21667,
"preview": "\r\n\r\n\\section{Sparse Tensors }\\label{sparse-tensors}\r\n\r\nNote: Functions taking \\texttt{Tensor} arguments can also take an"
},
{
"path": "tex_pdf/api/python/c4s09_io_ops.tex",
"chars": 88212,
"preview": "\r\n\r\n\\section{Inputs and Readers }\\label{inputs-and-readers}\r\n\r\nNote: Functions taking \\texttt{Tensor} arguments can also"
},
{
"path": "tex_pdf/api/python/c4s10_python_io.tex",
"chars": 4097,
"preview": "\r\n\r\n\\section{Data IO (Python functions) }\\label{data-io-python-functions}\r\n\r\n\\subsection{Contents}\\label{contents}\r\n\r\n\\s"
},
{
"path": "tex_pdf/api/python/c4s11_nn.tex",
"chars": 68733,
"preview": "\r\n\r\n\\begin{document}\r\n\r\n\\section{Neural Network }\\label{neural-network}\r\n\r\nNote: Functions taking \\texttt{Tensor} argume"
},
{
"path": "tex_pdf/api/python/c4s12_client.tex",
"chars": 33824,
"preview": "\r\n\r\n\\section{Running Graphs }\\label{running-graphs}\r\n\r\n\\subsection{Contents}\\label{contents}\r\n\r\n\\subsubsection{\\texorpdf"
},
{
"path": "tex_pdf/api/python/c4s13_train.tex",
"chars": 88310,
"preview": "\r\n\r\n\\section{Training }\\label{training}\r\n\r\n\\subsection{Contents}\\label{contents}\r\n\r\n\\subsubsection{\\texorpdfstring{\\prot"
},
{
"path": "tex_pdf/api/python/index.tex",
"chars": 29544,
"preview": "\r\n\r\n\\section{TensorFlow Python reference documentation\r\n}\\label{tensorflow-python-reference-documentation}\r\n\r\n\\begin{ite"
},
{
"path": "tex_pdf/get_started/c1s01_introduction.tex",
"chars": 3600,
"preview": "%!TEX program = xelatex\r\n% Encoding: UTF8\r\n% SEIKA 2016 | seika@live.ca\r\n\r\n% Chapter 1\r\n% Section 1.1 Introduction\r\n\r\n\\s"
},
{
"path": "tex_pdf/get_started/c1s02_os_setup.tex",
"chars": 27036,
"preview": "%!TEX program = xelatex\r\n% Encoding: UTF8\r\n% SEIKA 2016 | seika@live.ca\r\n\r\n% Chapter 1\r\n% Section 1.2 OS_Setup\r\n\r\n\r\n\\sec"
},
{
"path": "tex_pdf/get_started/c1s03_basic_usage.tex",
"chars": 16344,
"preview": "%!TEX program = xelatex\r\n% Encoding: UTF8\r\n% SEIKA 2016 | seika@live.ca\r\n\r\n% Chapter 1\r\n% Section 1.3 Introduction\r\n\r\n\\s"
},
{
"path": "tex_pdf/how_tos/c3s00_overview.tex",
"chars": 2340,
"preview": "\r\n\r\n% \\section{综述 Overview}\\label{ux7efcux8ff0-overview}\r\n\r\n综述 Overview\r\n\r\n\\subsection{Variables:\r\n创建,初始化,保存,和恢复}\\label{"
},
{
"path": "tex_pdf/how_tos/c3s01_variables.tex",
"chars": 6026,
"preview": "%!TEX program = xelatex\r\n% Encoding: UTF8\r\n% SEIKA 2015\r\n\r\n\r\n% Chapter 3 How to ...\r\n% Section 3.1\r\n\r\n\r\n\r\n\\section{变量:创建"
},
{
"path": "tex_pdf/how_tos/c3s02_variable_scope.tex",
"chars": 20837,
"preview": "\r\n\r\n\\section{共享变量}\\label{ux5171ux4eabux53d8ux91cf}\r\n\r\n你可以在\\href{tensorflow-zh/SOURCE/how_tos/variables/index.md}{怎么使用变量}"
},
{
"path": "tex_pdf/how_tos/c3s03_viz_learning.tex",
"chars": 3847,
"preview": "\r\n\r\n\\section{TensorBoard:可视化学习 }\\label{vis_learning}\r\n\r\nTensorBoard\r\n涉及到的运算,通常是在训练庞大的深度神经网络中出现的复杂而又难以理解的运算。\r\n\r\n为了更方便 Ten"
},
{
"path": "tex_pdf/how_tos/c3s04_graph_viz.tex",
"chars": 8347,
"preview": "\r\n\r\n\\section{TensorBoard: 图表可视化\r\n}\\label{tensorboard-ux56feux8868ux53efux89c6ux5316}\r\n\r\nTensorFlow\r\n图表计算强大而又复杂,图表可视化在理解和"
},
{
"path": "tex_pdf/how_tos/c3s05_reading_data.tex",
"chars": 21531,
"preview": "\r\n\r\n\\section{数据读取 }\\label{ux6570ux636eux8bfbux53d6}\r\n\r\nTensorFlow程序读取数据一共有3种方法:\r\n\r\n\\begin{itemize}\r\n\\tightlist\r\n\\item\r\n "
},
{
"path": "tex_pdf/how_tos/c3s06_threading_and_queues.tex",
"chars": 6378,
"preview": "\r\n\r\n\\section{线程和队列 }\\label{ux7ebfux7a0bux548cux961fux5217}\r\n\r\n在使用TensorFlow进行异步计算时,队列是一种强大的机制。\r\n\r\n正如TensorFlow中的其他组件一样,队"
},
{
"path": "tex_pdf/how_tos/c3s07_adding_an_op.tex",
"chars": 38304,
"preview": "\r\n\r\n\\section{增加一个新 Op }\\label{ux589eux52a0ux4e00ux4e2aux65b0-op}\r\n\r\n预备知识:\r\n\r\n\\begin{itemize}\r\n\\tightlist\r\n\\item\r\n 对 C++"
},
{
"path": "tex_pdf/how_tos/c3s08_new_data_formats.tex",
"chars": 9437,
"preview": "\r\n\r\n\\section{自定义数据读取\r\n}\\label{ux81eaux5b9aux4e49ux6570ux636eux8bfbux53d6}\r\n\r\n基本要求:\r\n\r\n\\begin{itemize}\r\n\\tightlist\r\n\\item"
},
{
"path": "tex_pdf/how_tos/c3s09_using_gpu.tex",
"chars": 9209,
"preview": "\r\n\r\n\\section{使用 GPUs }\\label{ux4f7fux7528-gpus}\r\n\r\n\\subsection{支持的设备 }\\label{ux652fux6301ux7684ux8bbeux5907}\r\n\r\n在一套标准的系统"
},
{
"path": "tex_pdf/tensorflow_manual_cn.idx",
"chars": 334,
"preview": "\\indexentry{graph|hyperpage}{27}\n\\indexentry{session|hyperpage}{27}\n\\indexentry{tensor|hyperpage}{27}\n\\indexentry{variab"
},
{
"path": "tex_pdf/tensorflow_manual_cn.ilg",
"chars": 391,
"preview": "This is makeindex, version 2.15 [TeX Live 2015/W32TeX] (kpathsea + Thai support).\nScanning input file tensorflow_manual_"
},
{
"path": "tex_pdf/tensorflow_manual_cn.ind",
"chars": 410,
"preview": "\\begin{theindex}\n\n \\item graph, \\hyperpage{26}\n\n \\indexspace\n\n \\item MNIST 数据集, \\hyperpage{37}\n\n \\indexspace\n\n \\ite"
},
{
"path": "tex_pdf/tensorflow_manual_cn.tex",
"chars": 5599,
"preview": "%!TEX program = xelatex\r\n% Encoding: UTF8\r\n% SEIKA 2015\r\n\r\n%\\documentclass[a4paper,11pt,twoside]{book}\r\n\\documentclass[a"
},
{
"path": "tex_pdf/tutorials/c2s00_overview.tex",
"chars": 4139,
"preview": "%!TEX program = xelatex\r\n% Encoding: UTF8\r\n% SEIKA 2015\r\n\r\n\r\n% Chapter 2 TutorialsHow to ...\r\n% Section 2.1\r\n\r\n% \\sectio"
},
{
"path": "tex_pdf/tutorials/c2s01_minist_beginners.tex",
"chars": 26980,
"preview": "%!TEX program = xelatex\r\n% Encoding: UTF8\r\n% SEIKA 2015\r\n\r\n\r\n% Chapter 2 TutorialsHow to ...\r\n% Section 2.2\r\n\r\n\\newpage\r"
},
{
"path": "tex_pdf/tutorials/c2s02_minist_pros.tex",
"chars": 22510,
"preview": "%!TEX program = xelatex\r\n% Encoding: UTF8\r\n% SEIKA 2015\r\n\r\n\r\n% Chapter 2 Tutorials\r\n% Section 2.3 minist_pros\r\n\r\n\r\n\\newp"
},
{
"path": "tex_pdf/tutorials/c2s03_.tex",
"chars": 15254,
"preview": "%!TEX program = xelatex\r\n% Encoding: UTF8\r\n% SEIKA 2015\r\n\r\n\r\n% Chapter 2 Tutorials\r\n% Section 2.4 TensorFlow Mechanics 1"
},
{
"path": "tex_pdf/tutorials/c2s04_.tex",
"chars": 20718,
"preview": "%!TEX program = xelatex\r\n% Encoding: UTF8\r\n% SEIKA 2015\r\n\r\n\r\n% Chapter 2 Tutorials\r\n% Section 2.5\r\n\r\n\r\n\\newpage\r\n\\sectio"
},
{
"path": "tex_pdf/tutorials/c2s05_word2vec.tex",
"chars": 13575,
"preview": "%!TEX program = xelatex\r\n% Encoding: UTF8\r\n% SEIKA 2015\r\n\r\n\\section{Vector Representations of Words}\\label{word2vec}\r\n\r\n"
},
{
"path": "tex_pdf/tutorials/c2s06_recurrent.tex",
"chars": 7233,
"preview": "\r\n\r\n\\section{循环神经网络 }\\label{ux5faaux73afux795eux7ecfux7f51ux7edc}\r\n\r\n\\subsection{介绍 }\\label{ux4ecbux7ecd}\r\n\r\n可以在\r\n\\href{"
},
{
"path": "tex_pdf/tutorials/c2s07_seq2seq.tex",
"chars": 20277,
"preview": "\\section{Sequence-to-Sequence Models\r\n}\\label{sequence-to-sequence-models}\r\n\r\nRecurrent neural networks can learn to mod"
},
{
"path": "tex_pdf/tutorials/c2s08_2_9_mandelbrot.tex",
"chars": 5095,
"preview": "\r\n\r\n\\section{曼德布洛特(Mandelbrot)集合\r\n}\\label{ux66fcux5fb7ux5e03ux6d1bux7279mandelbrotux96c6ux5408}\r\n\r\n虽然可视化曼德布洛特(Mandelbrot"
},
{
"path": "tex_pdf/tutorials/c2s09_pdes.tex",
"chars": 7717,
"preview": "\r\n\r\n\\section{偏微分方程 }\\label{ux504fux5faeux5206ux65b9ux7a0b}\r\n\r\n\\textbf{\\emph{TensorFlow}}\r\n不仅仅是用来机器学习,它更可以用来模拟仿真。在这里,我们将通"
},
{
"path": "tex_pdf/tutorials/c2s10_mnist_download.tex",
"chars": 4766,
"preview": "\r\n\r\n\\section{MNIST 数据下载 }\\label{mnist-ux6570ux636eux4e0bux8f7d}\r\n\r\n源码:\r\n\\href{https://tensorflow.googlesource.com/tensor"
}
]
About this extraction
This page contains the full source code of the jikexueyuanwiki/tensorflow-zh GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 181 files (2.2 MB), approximately 590.4k tokens, and a symbol index with 62 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.