class_docstr: Test the PipelineHelper class.
class_docstr_tok: ["Test","the","PipelineHelper","class","."]
code: def test_guess_split(self):
      t = torch.randn(128, 5)
      assert PipelineHelper.guess_split_size(t, 8) == 8
      assert PipelineHelper.guess_split_size(t, 4) == 16
      assert PipelineHelper.guess_split_size(t, 1) == 128
      t = torch.randn(129, 5)
      assert PipelineHelper.guess_split_size(t, 8) == 8
      assert PipelineHelper.guess_split_size(t, 4) == 16
      assert PipelineHelper.guess_split_size(t, 1) == 129
      t = torch.randn(5, 128)
      assert PipelineHelper.guess_split_size(t, 8, dim=1) == 8
      assert PipelineHelper.guess_split_size(t, 4, dim=1) == 16
      assert PipelineHelper.guess_split_size(t, 1, dim=1) == 128
  
      # tuple
      t = torch.randn(128, 5)
      assert PipelineHelper.guess_split_size((t, t), 8) == 8
      assert PipelineHelper.guess_split_size((t, t), 1) == 128
  
      # dict
      t = torch.randn(128, 5)
      assert PipelineHelper.guess_split_size({"x": t, "y": t}, 8) == 8
      assert PipelineHelper.guess_split_size({"x": t, "y": t}, 1) == 128
  
      with self.assertRaises(TypeError):
          t = torch.randn(128, 5)
          PipelineHelper.guess_split_size([t, t], 1)
  
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 1 for calling the TestPipelineHelper obj's underlying member method code with example usage: obj.test_guess_split() without return types