code: def test_padded_tensor(self):
      # list of lists
      lol = [[1, 2], [3, 4, 5]]
      output, lens = padded_tensor(lol)
      assert np.all(output.numpy() == np.array([[1, 2, 0], [3, 4, 5]]))
      assert lens == [2, 3]
      output, _ = padded_tensor(lol, left_padded=True)
      assert np.all(output.numpy() == np.array([[0, 1, 2], [3, 4, 5]]))
      output, _ = padded_tensor(lol, pad_idx=99)
      assert np.all(output.numpy() == np.array([[1, 2, 99], [3, 4, 5]]))
  
imports: import torch
  import numpy
  import unittest
  from parlai.utils.torch import padded_tensor, argsort, PipelineHelper, neginf, IdentityLayer, trainable_parameters, total_parameters
label_desc: Use image node_id 2 for calling the TestTorchUtils obj's underlying member method code with example usage: obj.test_padded_tensor() without return types