Custom loss and _make_shard_state() function

I found that in order to use custom loss you have to implement _make_shard_state function


But I didn’t get the idea of shards and what exactly should I write in the “_make_shard_state()” function.
Any explanation of “shards” would be helpful. Thank you.