What are tf.IndexedSlices and dense gradients in keras? Why do a keras optimizer distinguish between them?

I want to know what is the difference between tf.IndexedSlices and dense gradients. Why do a keras optimizer distinguish between them while updating the variables at each step? thank you

Hi @dali_dali, tf.IndexedSlices gradients are used when computing gradients for sparse tensors, whereas dense gradients are used when computing gradients for dense tensors. Distinguish between them allows you to use the appropriate gradient representation for the type of tensor being used. Thank You.