code: def accuracy(self, logits, y):
      # currently IPU poptorch doesn't implicit convert bools to tensor
      # hence we use an explicit calculation for accuracy here. Once fixed in poptorch
      # we can use the accuracy metric.
      return torch.sum(
          torch.eq(torch.argmax(logits, -1), y).to(torch.float32)
      ) / len(y)
  
file_path: pytorch-lightning/examples/pytorch/ipu/mnist_sample.py
imports: import torch
  from lightning.pytorch import LightningModule, Trainer
  from lightning.pytorch.demos.mnist_datamodule import MNISTDataModule
  from torch.nn import functional
label_desc: Use image node_id 6 for calling the LitClassifier obj's underlying member method code with example usage: obj.accuracy(logits, y) and returns: unknown