colossalai.nn.metric.accuracy_3d

class colossalai.nn.metric.accuracy_3d.Accuracy3D[source]

Accuracy for 3D parallelism

forward(logits, targets)[source]

Calculate the accuracy of predicted labels.

Parameters
  • logits (torch.tensor) – Predicted labels.

  • targets (torch.tensor) – True labels from data.

Returns

the accuracy of prediction.

Return type

float