What determines allocation of operations to CPU vs GPU?

In the below image you can see that some operations get put on the CPU while others are on the GPU. How is it determined which operations end up on the CPU as opposed to the GPU? There’s one operation, reshape, which took place on both the CPU and the GPU, so clearly not all operations are limited to one or the other.

Hi @John_S

Welcome to the TensorFlow Forum!

It’s completely true that some operations get put on the CPU while others are on the GPU and What determines it is depends on supporting hardware availability (GPU) and if that API have operation support implemented for GPUs.

The TensorFlow framework checks if a compatible GPU is available with sufficient memory to handle the operation. If not, it defaults to the CPU. Likewise not all TensorFlow operations have optimized implementations for GPUs. If a GPU-specific implementation doesn’t exist, the CPU version is used.

Please refer to this GPU link for more details in this. Thank you.