官术网_书友最值得收藏!

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.

主站蜘蛛池模板: 稻城县| 朝阳市| 尼勒克县| 子洲县| 成都市| 金溪县| 石河子市| 微山县| 南城县| 普格县| 安多县| 图木舒克市| 肇庆市| 黄冈市| 遂宁市| 西畴县| 常德市| 连平县| 平邑县| 铜川市| 新乡市| 中阳县| 会东县| 合作市| 盱眙县| 镇康县| 上林县| 彝良县| 额尔古纳市| 陇川县| 清徐县| 颍上县| 溆浦县| 永仁县| 安泽县| 出国| 拜泉县| 广安市| 互助| 永嘉县| 五河县|