Recall & Review
beginner
What is eager execution in TensorFlow?
Eager execution runs operations immediately as they are called, like normal Python code. It is easy to debug and understand because results are returned right away.
Click to reveal answer
beginner
What is graph execution in TensorFlow?
Graph execution builds a computation graph first, then runs it all at once. This can be faster and more efficient for large models but harder to debug.
Click to reveal answer
beginner
How does eager execution help beginners?
Eager execution lets beginners see results immediately, making it easier to test and fix code step-by-step, just like regular Python programming.
Click to reveal answer
intermediate
Why might someone choose graph execution over eager execution?
Graph execution can optimize the whole computation, making it faster and better for deploying models in production where speed matters.
Click to reveal answer
intermediate
Can TensorFlow switch between eager and graph execution?
Yes, TensorFlow 2 uses eager execution by default but can convert code to graph execution using @tf.function to get speed benefits.
Click to reveal answer
What does eager execution in TensorFlow do?
✗ Incorrect
Eager execution runs operations immediately and returns results, making it easy to debug.
Which TensorFlow mode is usually faster for large models?
✗ Incorrect
Graph execution can optimize and run the whole computation graph efficiently, making it faster for large models.
How can you convert eager code to graph execution in TensorFlow 2?
✗ Incorrect
The @tf.function decorator converts eager code into a graph for better performance.
Which is true about eager execution?
✗ Incorrect
Eager execution runs operations step-by-step immediately, making debugging easier.
Why might graph execution be harder for beginners?
✗ Incorrect
Graph execution requires understanding how to build and run computation graphs, which can be confusing for beginners.
Explain the difference between eager execution and graph execution in TensorFlow.
Think about how and when TensorFlow runs your code.
You got /4 concepts.
Describe a situation where you would prefer eager execution over graph execution.
Consider what helps you understand your code better.
You got /3 concepts.