- Mastering TensorFlow 1.x
- Armando Fandango
- 165字
- 2021-06-25 22:50:56
Order of execution and lazy loading
The nodes are executed in the order of dependency. If node a depends on node b, then a will be executed before b when the execution of b is requested. A node is not executed unless either the node itself or another node depending on it is not requested for execution. This is also known as lazy loading; namely, the node objects are not created and initialized until they are needed.
Sometimes, you may want to control the order in which the nodes are executed in a graph. This can be achieved with the tf.Graph.control_dependencies() function. For example, if the graph has nodes a, b, c, and d and you want to execute c and d before a and b, then use the following statement:
with graph_variable.control_dependencies([c,d]):
# other statements here
This makes sure that any node in the preceding with block is executed only after nodes c and d have been executed.
- 24小時學會電腦組裝與維護
- OpenGL Game Development By Example
- SiFive 經典RISC-V FE310微控制器原理與實踐
- 微型計算機系統原理及應用:國產龍芯處理器的軟件和硬件集成(基礎篇)
- RISC-V處理器與片上系統設計:基于FPGA與云平臺的實驗教程
- Hands-On Motion Graphics with Adobe After Effects CC
- 3D Printing Blueprints
- Spring Cloud實戰
- The Artificial Intelligence Infrastructure Workshop
- The Deep Learning with PyTorch Workshop
- UML精粹:標準對象建模語言簡明指南(第3版)
- Raspberry Pi Home Automation with Arduino
- Hands-On One-shot Learning with Python
- 新編計算機組裝與維護
- 101 UX Principles