docstr: Performs test and computes the accuracy of the model
  
  :param test_batch: Batch data
  :param batch_idx: Batch indices
  
  :return: output - Testing accuracy
docstr_tok: ["Performs","test","and","computes","the","accuracy","of","the","model",":","param","test_batch",":","Batch","data",":","param","batch_idx",":","Batch","indices",":","return",":","output","-","Testing","accuracy"]
code: def test_step(self, test_batch, batch_idx):
      """
      Performs test and computes the accuracy of the model
  
      :param test_batch: Batch data
      :param batch_idx: Batch indices
  
      :return: output - Testing accuracy
      """
      input_ids = test_batch["input_ids"].to(self.device)
      attention_mask = test_batch["attention_mask"].to(self.device)
      targets = test_batch["targets"].to(self.device)
      output = self.forward(input_ids, attention_mask)
      _, y_hat = torch.max(output, dim=1)
      test_acc = torch.tensor(
          accuracy_score(y_hat.cpu(), targets.cpu())
      )
      self.test_outputs.append(test_acc)
      return {"test_acc": test_acc}
  
imports: import math
  import os
  import lightning
  import pandas
  import torch
  import torch.nn.functional
  import torchtext.datasets
  from lightning.pytorch.callbacks import EarlyStopping, LearningRateMonitor, ModelCheckpoint
  from lightning.pytorch.cli import LightningCLI
  from sklearn.datasets import fetch_20newsgroups
  from sklearn.metrics import accuracy_score
  from sklearn.model_selection import train_test_split
  from torch import nn
  from torch.utils.data import DataLoader
  from torch.utils.data.dataset import random_split
  from torchdata.datapipes.iter import IterDataPipe
  from torchtext.data.functional import to_map_style_dataset
  from torchtext.datasets import AG_NEWS
  from transformers import BertModel, BertTokenizer
  import mlflow.pytorch
label_desc: Use image node_id 4 for calling the BertNewsClassifier obj's underlying member method code with example usage: obj.test_step(test_batch, batch_idx) and returns: dict