code: def test_center_crop_video(self):
      numFrames = random.randint(4, 128)
      height = random.randint(10, 32) * 2
      width = random.randint(10, 32) * 2
      oheight = random.randint(5, (height - 2) / 2) * 2
      owidth = random.randint(5, (width - 2) / 2) * 2
  
      clip = (
          torch.ones((numFrames, height, width, 3), dtype=torch.uint8)
          * 255
      )
      oh1 = (height - oheight) // 2
      ow1 = (width - owidth) // 2
      clipNarrow = clip[:, oh1 : oh1 + oheight, ow1 : ow1 + owidth, :]
      clipNarrow.fill_(0)
      result = Compose(
          [
              transforms.ToTensorVideo(),
              transforms.CenterCropVideo((oheight, owidth)),
          ]
      )(clip)
  
      msg = (
          "height: "
          + str(height)
          + " width: "
          + str(width)
          + " oheight: "
          + str(oheight)
          + " owidth: "
          + str(owidth)
      )
      assert result.sum().item() == 0, msg
  
      oheight += 1
      owidth += 1
      result = Compose(
          [
              transforms.ToTensorVideo(),
              transforms.CenterCropVideo((oheight, owidth)),
          ]
      )(clip)
      sum1 = result.sum()
  
      msg = (
          "height: "
          + str(height)
          + " width: "
          + str(width)
          + " oheight: "
          + str(oheight)
          + " owidth: "
          + str(owidth)
      )
      assert sum1.item() > 1, msg
  
      oheight += 1
      owidth += 1
      result = Compose(
          [
              transforms.ToTensorVideo(),
              transforms.CenterCropVideo((oheight, owidth)),
          ]
      )(clip)
      sum2 = result.sum()
  
      msg = (
          "height: "
          + str(height)
          + " width: "
          + str(width)
          + " oheight: "
          + str(oheight)
          + " owidth: "
          + str(owidth)
      )
      assert sum2.item() > 1, msg
      assert sum2.item() > sum1.item(), msg
  
file_path: vision/test/test_transforms_video.py
imports: import random
  import warnings
  import numpy
  import pytest
  import torch
  from common_utils import assert_equal
  from torchvision.transforms import Compose
label_desc: Use image node_id 3 for calling the TestVideoTransforms obj's underlying member method code with example usage: obj.test_center_crop_video() without return types