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.