code: def test_packed_sequence():
      """Test to ensure RNN packed sequences are modified correctly."""
      rnn = nn.RNN(5, 5)
  
      x = torch.rand((5, 1, 5), dtype=torch.float)
      seq_length = torch.tensor([4], dtype=torch.int)
  
      def fill_fn(x):
          x.fill_(0)
  
      x = nn.utils.rnn.pack_padded_sequence(x, seq_length)
      x, h = rnn(x)
      x = apply_to_tensors(fill_fn, x)
      x, _ = nn.utils.rnn.pad_packed_sequence(x)
      assert torch.sum(x) == 0
  
file_path: fairscale/tests/utils/test_containers.py
imports: from collections import OrderedDict, namedtuple
  import random
  import pytest
  import torch
  import torch.nn
  from fairscale.internal.containers import apply_to_tensors, pack_kwargs, split_non_tensors, unpack_kwargs, unpack_non_tensors
label_desc: Use image node_id 4 for calling a global function with example usage: test_packed_sequence() without return types