class_docstr: Post processor for MASTER architectures
class_docstr_tok: ["Post","processor","for","MASTER","architectures"]
code: def __call__(
      self,
      logits: torch.Tensor,
  ) -> List[Tuple[str, float]]:
      # compute pred with argmax for attention models
      out_idxs = logits.argmax(-1)
      # N x L
      probs = torch.gather(
          torch.softmax(logits, -1), -1, out_idxs.unsqueeze(-1)
      ).squeeze(-1)
      # Take the minimum confidence of the sequence
      probs = probs.min(dim=1).values.detach().cpu()
  
      # Manual decoding
      word_values = [
          "".join(self._embedding[idx] for idx in encoded_seq).split(
              "<eos>"
          )[0]
          for encoded_seq in out_idxs.cpu().numpy()
      ]
  
      return list(zip(word_values, probs.numpy().clip(0, 1).tolist()))
  
imports: from copy import deepcopy
  from typing import Any, Callable, Dict, List, Optional, Tuple
  import torch
  from torch import nn
  from torch.nn import functional
  from torchvision.models._utils import IntermediateLayerGetter
  from doctr.datasets import VOCABS
  from doctr.models.classification import magc_resnet31
  from doctr.models.modules.transformer import Decoder, PositionalEncoding
  from ...utils.pytorch import _bf16_to_float32, load_pretrained_params
  from .base import _MASTER, _MASTERPostProcessor
label_desc: Use image node_id 1 for calling the MASTERPostProcessor obj's underlying member method code with example usage: obj.__call__(logits) and returns: list