Dice coefficient for multi-channel one-hot enocoded ground truth/prediction

Is there any dice coefficient library/repo for one hot encoded multi-channel 3D image?
Both the pred and gt are binary with shape: [2, 9, 64, 64, 64]

The returned dice should be channel-wise and combined if possible.