code: def _gen_right_context(self, input: torch.Tensor) -> torch.Tensor:
      T = input.shape[0]
      num_segs = math.ceil(
          (T - self.right_context_length) / self.segment_length
      )
      right_context_blocks = []
      for seg_idx in range(num_segs - 1):
          start = (seg_idx + 1) * self.segment_length
          end = start + self.right_context_length
          right_context_blocks.append(input[start:end])
      right_context_blocks.append(
          input[T - self.right_context_length :]
      )
      return torch.cat(right_context_blocks)
  
imports: import math
  from typing import List, Optional, Tuple
  import torch
label_desc: Use image node_id 2 for calling the _EmformerImpl obj's underlying member method code with example usage: obj._gen_right_context(input) and returns: torch