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

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.

主站蜘蛛池模板: 行唐县| 苏州市| 雅江县| 开鲁县| 辽宁省| 剑川县| 汉源县| 宣化县| 青阳县| 隆德县| 汉沽区| 大荔县| 呈贡县| 中宁县| 麻江县| 会泽县| 河曲县| 南汇区| 阿鲁科尔沁旗| 屏东市| 塔城市| 平阳县| 海原县| 商南县| 疏勒县| 克东县| 津南区| 梧州市| 萝北县| 闵行区| 成都市| 南安市| 揭西县| 新昌县| 镇沅| 抚顺市| 柳江县| 枞阳县| 聂拉木县| 阿克苏市| 江门市|