In this video, we'll look at some of the basic operations of AutoGraph. We'll start by just making sure TensorFlow is running and we can see that it is. Now we'll look at our add function, where we're adding a to b just returning a plus b and we're taking in two parameters and was specifying those parameters as tf.variables. You can see here that there holding two-by-two tensors, one containing 1,2,3,4 one containing 4,0,1,5, and we'll add them. When I run this, we can see that the result is 5,2,4,9, which is correct. One plus 4 is 5, 2 plus 0 is 2, 3 plus 1 is 4, 4 plus 5 is 9. But by calling tf.autograph to code and saying the ads Python function being passed into that. We can actually look at the graph code. We can see the graph code is pretty simple. What we're doing in the graph code with this one for an add is to use these ag. function scope and ag stands for AutoGraph feel seed ag everywhere. So within an ag function scope, we're just going to create a return val, which is the function scopes, where we're mocking the return value with a plus b and returning that back. These ag, undefined return value ag function scopes are actually helper wrappers around the underlying graph code, the really raw graph code there you can inspect if you want, just take a look at TensorFlow and open source and you'll see them. But in this case, the code that will run in a graph within a session runs within this function scope. You can see here ultimately what it's doing, it's the same thing. It's creating a new value of a plus b and returning that. Let's look at something a little more complex and this is where we have a conditional. Now my f of x is if x is greater than 0, we'll return x squared otherwise we'll return x. When we say tf.autograph for code on this one, we can start seeing that there's a lot more of these little functions being created. Because remember, everything has to operate either as a variable or as an operation within a graph. Even simple things like our ifs statements and is going to operate as a function. For example here we're going to say, again, ag is AutoGraph. So an if statement is going to do a conditional and the conditional was saying is x greater than 0, that's either going to be true or false. If it's true, you call the function called if true. If it's false, you call the function called if false. While here we didn't actually have to have separate functions for it, the control flow would just fall down the route that we want, here, we have to have them as functions. If the conditional is true, we call if true. What's if true going to do is that it's actually going to create a new temporary variable because it doesn't know if it's going to overwrite x or not. Remember, we're saying x equals x squared. So creates this new temporary variable called x_1, assigns that to x, then squares x_1, and then returns that value. Again, keeping the idea of variables and functions separate and in this case, not sure if we want to overwrite x are not, AutoGraph was smart enough to create these temporary variables for us. Of course, if the conditional x greater than 0 was false, then we go to the if false function which just returns x. The game FizzBuzz as you can tell, it's going to be very long because there's so many conditionals and there's so many functions in there. So I've created the game FizzBuzz and you can see then here tf.autograph to code passing the Python function for that. If you want to take a look through this, there's a lot of code here, but the one thing to look out for that is really interesting is the nested if statements. For example, your first if statement was the conditional if the number mode 5 is equal to 0. If we go back to our code, we can see that it's actually the bottom of the if statements here, if the number mode 5 was equal to 0. But what that's going to do is print buzz. But look at what it does in the AutoGraph code. Again, we have the conditional, it's going to call something if true, it's going to call something and false. If true, it's going to print buzz and were able to move on. Then the next conditional was if the number mode 3 is equal to 0. But we already have a function called if true and a function called a if false. What AutoGraph did was for conditional one, and it also generated a conditional underscore one instead of conditional, it now has an if true_1 and an if false_1. Again, if you go up and you can see your if false_1 is here and you'll have an if true_1 as well. Your if true_1 of course is going to produce phase, your if false_1 is going to take you then within another nested loop. Again here we have yet another conditional and that is if the num mod three is 0 and the number mod five is 0 because they're handed together here. What does it do? It automatically generates conditional two, it automatically generates if true_2 and if false_2. This way, as it's generating these functions and it's generating these conditionals, it's automatically naming them for you. Take a look at it, go through it, have a bit of a look at this and try to understand how AutoGraph will convert your code into graph-based code. You may not always want to do this, but you will experience if you're looking to do like cutting edge state-of-the-art speed, a lot of times it would be good for you to use tf. function and to use graphs instead of using the Pythonic eager execution. Something like this that has lots of little ops, it makes very complicated code, it'll be really hard for you to write this by hand, but if you get a speed boost out of its, then write it by hand in typical Python and then use AutoGraph to convert it.