code: def rescale_stride(tokens_or_logits, stride, ratio):
      """
      Rescales the stride values from audio space to tokens/logits space.
  
      (160_000, 16_000, 16_000) -> (2000, 200, 200) for instance.
      """
      # Shape is [B, SEQ] for tokens
      # [B, SEQ, V] for logits
  
      new_strides = []
      for input_n, left, right in stride:
          token_n = int(round(input_n * ratio))
          left = int(round(left / input_n * token_n))
          right = int(round(right / input_n * token_n))
          new_stride = (token_n, left, right)
          new_strides.append(new_stride)
  
      return new_strides
  
file_path: H2O/h2o_flexgen/benchmark/third_party/transformers/src/transformers/pipelines/automatic_speech_recognition.py
imports: import inspect
  from collections import defaultdict
  from typing import TYPE_CHECKING, Dict, Optional, Union
  import numpy
  from ..utils import is_torch_available, logging
  from .audio_utils import ffmpeg_read
  from .base import ChunkPipeline
label_desc: Use image node_id 1 for calling a global function with example usage: rescale_stride(tokens_or_logits, stride, ratio) and returns: new_strides