code: def wrap_packed_sequences_recursive(
      unwrapped, batch_sizes, sorted_indices
  ):
      """Wrap packed tensors by `PackedSequence`.
  
      Args:
          unwrapped (object): Packed but unwrapped tensor(s).
          batch_sizes (Tensor): See `PackedSequence.batch_sizes`.
          sorted_indices (Tensor): See `PackedSequence.sorted_indices`.
  
      Returns:
          object: Packed sequences. If `unwrapped` is a tensor, then the returned
              value is a `PackedSequence`. If `unwrapped` is a tuple of tensors,
              then the returned value is a tuple of `PackedSequence`s.
      """
      if isinstance(unwrapped, torch.Tensor):
          return torch.nn.utils.rnn.PackedSequence(
              unwrapped,
              batch_sizes=batch_sizes,
              sorted_indices=sorted_indices,
          )
      if isinstance(unwrapped, tuple):
          return tuple(
              wrap_packed_sequences_recursive(
                  x, batch_sizes, sorted_indices
              )
              for x in unwrapped
          )
      return unwrapped
  
file_path: pfrl/pfrl/utils/recurrent.py
imports: import itertools
  import numpy
  import torch
  from torch import nn
label_desc: Use image node_id 10 for calling a global function with example usage: wrap_packed_sequences_recursive(unwrapped, batch_sizes, sorted_indices) and returns: unwrapped, torch, tuple