docstr: Test the case when video is already in memory, and decoder reads data in memory.
  Compare frame pts between decoding for pts only and full decoding
  for both pts and frame data
docstr_tok: ["Test","the","case","when","video","is","already","in","memory",",","and","decoder","reads","data","in","memory",".","Compare","frame","pts","between","decoding","for","pts","only","and","full","decoding","for","both","pts","and","frame","data"]
code: def test_read_video_from_memory_get_pts_only(
      self, test_video, config
  ):
      """
      Test the case when video is already in memory, and decoder reads data in memory.
      Compare frame pts between decoding for pts only and full decoding
      for both pts and frame data
      """
      # video related
      width, height, min_dimension, max_dimension = 0, 0, 0, 0
      video_start_pts, video_end_pts = 0, -1
      video_timebase_num, video_timebase_den = 0, 1
      # audio related
      samples, channels = 0, 0
      audio_start_pts, audio_end_pts = 0, -1
      audio_timebase_num, audio_timebase_den = 0, 1
  
      _, video_tensor = _get_video_tensor(VIDEO_DIR, test_video)
  
      # pass 1: decode all frames using cpp decoder
      tv_result = torch.ops.video_reader.read_video_from_memory(
          video_tensor,
          SEEK_FRAME_MARGIN,
          0,  # getPtsOnly
          1,  # readVideoStream
          width,
          height,
          min_dimension,
          max_dimension,
          video_start_pts,
          video_end_pts,
          video_timebase_num,
          video_timebase_den,
          1,  # readAudioStream
          samples,
          channels,
          audio_start_pts,
          audio_end_pts,
          audio_timebase_num,
          audio_timebase_den,
      )
      assert abs(config.video_fps - tv_result[3].item()) < 0.01
  
      # pass 2: decode all frames to get PTS only using cpp decoder
      tv_result_pts_only = (
          torch.ops.video_reader.read_video_from_memory(
              video_tensor,
              SEEK_FRAME_MARGIN,
              1,  # getPtsOnly
              1,  # readVideoStream
              width,
              height,
              min_dimension,
              max_dimension,
              video_start_pts,
              video_end_pts,
              video_timebase_num,
              video_timebase_den,
              1,  # readAudioStream
              samples,
              channels,
              audio_start_pts,
              audio_end_pts,
              audio_timebase_num,
              audio_timebase_den,
          )
      )
  
      assert not tv_result_pts_only[0].numel()
      assert not tv_result_pts_only[5].numel()
      self.compare_decoding_result(tv_result, tv_result_pts_only)
  
imports: import collections
  import math
  import os
  from fractions import Fraction
  import numpy
  import pytest
  import torch
  import torchvision.io
  from common_utils import assert_equal
  from numpy.random import randint
  from pytest import approx
  from torchvision import set_video_backend
  from torchvision.io import _HAS_VIDEO_OPT
label_desc: Use image node_id 17 for calling the TestVideoReader obj's underlying member method code with example usage: obj.test_read_video_from_memory_get_pts_only(test_video, config) without return types