code: def test_selective_backprop(self):
      pl_model = LightningModule(
          model,
          loss,
          optimizer,
          metrics=[
              torchmetrics.F1Score(
                  "multiclass", num_classes=num_classes
              ),
              torchmetrics.Accuracy(
                  "multiclass", num_classes=num_classes
              ),
          ],
      )
      data_loader = create_data_loader(
          data_dir, batch_size, num_workers, data_transform
      )
      loss_fn = nn.CrossEntropyLoss(reduction="none")
      sb = SelectiveBackprop(
          start=0.25,
          keep=0.53,
          end=0.5,
          scale_factor=0.1,
          interrupt=2,
          loss_fn=loss_fn,
      )
      batch_size_check = CheckBatchSize(
          start=0.25,
          keep=0.53,
          end=0.5,
          interrupt=2,
          batch_size=batch_size,
      )
      trainer = Trainer(
          max_epochs=4,
          log_every_n_steps=1,
          algorithms=[sb],
          callbacks=[batch_size_check],
      )
      trainer.fit(pl_model, data_loader, data_loader)
  
imports: from multiprocessing import reduction
  import os
  from unittest import TestCase
  import pytest
  import torch
  import torchmetrics
  from torch import nn
  import pytorch_lightning
  from pytorch_lightning.callbacks import Callback
  from pytorch_lightning.utilities.types import STEP_OUTPUT
  from typing import Any
  from test.pytorch.utils._train_torch_lightning import create_data_loader, data_transform
  from bigdl.nano.pytorch.lightning import LightningModule
  from bigdl.nano.pytorch import Trainer
  from bigdl.nano.pytorch.vision.models import vision
  from bigdl.nano.pytorch.algorithms.selective_backprop import SelectiveBackprop
label_desc: Use image node_id 1 for calling the TestLightningModuleFromTorch obj's underlying member method code with example usage: obj.test_selective_backprop() without return types