code: def __should_selective_backprop(
      self,
      current_duration: float,
      batch_idx: int,
      start: float = 0.5,
      end: float = 0.9,
      interrupt: int = 2,
  ) -> bool:
      is_interval = (current_duration >= start) and (
          current_duration < end
      )
      is_step = (interrupt == 0) or ((batch_idx + 1) % interrupt != 0)
  
      return is_interval and is_step
  
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 2 for calling the CheckBatchSize obj's underlying member method code with example usage: obj.__should_selective_backprop(current_duration, batch_idx, start, end, interrupt) and returns: unknown