- TensorFlow Machine Learning Projects
- Ankit Jain Armando Fandango Amita Kapoor
- 189字
- 2021-06-10 19:15:29
The order of execution and lazy loading
The nodes in a computation graph are executed in their order of dependency. If node x depends on node y, then x is executed before y when the execution of y is requested. A node is only executed if either the node itself or another node depending on it is invoked for execution. This execution philosophy is known as lazy loading. As the name implies, the node objects are not instantiated and initialized until they are actually required.
Often, it is necessary to control the order of the execution of the nodes in a computation graph. This can be done with the tf.Graph.control_dependencies() function. For example, if the graph has the nodes l, m, n, and o, and we want to execute n and o before l and m, then we would use the following code:
with graph_variable.control_dependencies([n,o]):
# other statements here
This makes sure that any node in the preceding with block is executed after nodes n and o have been executed.
- 電氣自動化專業英語(第3版)
- Dreamweaver CS3+Flash CS3+Fireworks CS3創意網站構建實例詳解
- 嵌入式系統應用
- Drupal 7 Multilingual Sites
- Visual FoxPro 6.0數據庫與程序設計
- Hands-On Neural Networks with Keras
- RPA:流程自動化引領數字勞動力革命
- 數據挖掘方法及天體光譜挖掘技術
- Java Web整合開發全程指南
- 工業機器人操作與編程
- MATLAB/Simulink權威指南:開發環境、程序設計、系統仿真與案例實戰
- AMK伺服控制系統原理及應用
- 電動汽車驅動與控制技術
- Unreal Development Kit Game Design Cookbook
- Apache Spark Quick Start Guide