In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article introduces what is the relationship between execution order and control dependence in Tensorflow. The content is very detailed. Interested friends can use it for reference. I hope it will be helpful to you.
Instead of running the defined operation immediately, Tensorflow creates the corresponding node in the graph and calculates it using the Session.run () method. This allows the Tensorflow to be optimized at run time to determine the best execution order and to trim unused nodes as much as possible. For the following example, we create three tensors, two constant tensors and another tensor that stores the result of the addition. We can't overwrite the value of the tensor here. If we want to change the value of the tensor, we have to create a new tensor and then assign it to it. The running result is 3.
Note: if there is only tf.Tensors in the figure, we don't need to worry about dependencies, but we may use tf.Variables,tf.Variables to make dependencies more complicated. So we try to use the tensor and let Variables do it only when the tensor doesn't work.
Unlike tensors, variables are updatable. How do we use variables to do the same thing above
The tensor c has an uncertain value here, which may be 3 or 7, depending on which addition operation or assignment operation is performed first.
The order of operations defined in the code has nothing to do with Tensorflow running. The only concern is to control dependencies. The control dependency of a tensor is simple, and each time a tensor is used in an operation, the operation defines the implicit dependency of the tensor. When dealing with variables, you need to use tf.control_dependencies () to explicitly define dependencies as follows.
So much for sharing the relationship between execution order and control dependency in Tensorflow. I hope the above content can be of some help and learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
You can get a lot of information from http://docs.seleniumhq.org/.
© 2024 shulou.com SLNews company. All rights reserved.