Recall & Review
beginner
What is the main difference between CPU and GPU in tensor placement?
CPU handles general tasks and is good for sequential operations, while GPU is specialized for parallel tasks, making it faster for large tensor operations in machine learning.
Click to reveal answer
beginner
How does TensorFlow decide where to place a tensor by default?
TensorFlow tries to place tensors on the GPU if available for faster computation; otherwise, it uses the CPU.
Click to reveal answer
intermediate
What is the TensorFlow command to explicitly place a tensor on the GPU?
Use with tf.device('/GPU:0'): to place tensors or operations explicitly on the first GPU device.
Click to reveal answer
intermediate
Why might you want to place tensors on the CPU instead of the GPU?
You might place tensors on the CPU if the GPU memory is limited, or for operations that are not efficient on GPU, like small or simple computations.
Click to reveal answer
advanced
What happens if you try to perform an operation on tensors placed on different devices?
TensorFlow will automatically copy data between devices, but this can slow down performance due to data transfer overhead.
Click to reveal answer
Which device is generally faster for large matrix multiplications in TensorFlow?
✗ Incorrect
GPUs are designed for parallel processing, making them faster for large matrix operations.
How do you specify a tensor to be placed on the CPU in TensorFlow?
✗ Incorrect
The '/CPU:0' device string places tensors on the CPU.
What is a downside of placing tensors on different devices for operations?
✗ Incorrect
Data transfer between devices adds overhead and slows down computation.
If no GPU is available, where does TensorFlow place tensors by default?
✗ Incorrect
TensorFlow defaults to CPU if no GPU is found.
Which TensorFlow function helps you check available devices?
✗ Incorrect
tf.config.list_physical_devices() lists available hardware devices like CPU and GPU.
Explain how TensorFlow manages tensor placement between CPU and GPU and why this matters.
Think about speed and where computations happen.
You got /4 concepts.
Describe a situation where placing tensors on CPU might be better than GPU.
Consider resource limits and operation size.
You got /4 concepts.