class_docstr: Args:
code: def _get_diff(self, input_x, keep_rgb=False):
      input_c = 3 if self.modality in ["RGB", "RGBDiff"] else 2
      input_view = input_x.view(
          (
              -1,
              self.num_segments,
              self.new_length + 1,
              input_c,
          )
          + input_x.size()[2:]
      )
      if keep_rgb:
          new_data = input_view.clone()
      else:
          new_data = input_view[:, :, 1:, :, :, :].clone()
  
      for x in reversed(list(range(1, self.new_length + 1))):
          if keep_rgb:
              new_data[:, :, x, :, :, :] = (
                  input_view[:, :, x, :, :, :]
                  - input_view[:, :, x - 1, :, :, :]
              )
          else:
              new_data[:, :, x - 1, :, :, :] = (
                  input_view[:, :, x, :, :, :]
                  - input_view[:, :, x - 1, :, :, :]
              )
  
      return new_data
  
imports: import torch
  from torch import nn
  from torch.nn.init import normal_, constant_
  import numpy
  import torchvision
  from towhee.models.utils.basic_ops import ConsensusModule
  from towhee.models.layers.non_local import make_non_local
  from towhee.models.tsm.mobilenet_v2 import mobilenet_v2, InvertedResidual
  from towhee.models.tsm.temporal_shift import TemporalShift, make_temporal_shift
  from towhee.models.tsm.config import _C
label_desc: Use image node_id 8 for calling the TSN obj's underlying member method code with example usage: obj._get_diff(input_x, keep_rgb) and returns: new_data