code: def test_balance_by_size_param():
      model = nn.Sequential(
          *[nn.Linear(i + 1, i + 2) for i in range(6)]
      )
      sample = torch.rand(7, 1)
      balance = balance_by_size(2, model, sample, param_scale=100)
      assert balance == [4, 2]
  
      model = nn.Sequential(
          *[nn.Linear(i + 2, i + 1) for i in reversed(range(6))]
      )
      sample = torch.rand(1, 7)
      balance = balance_by_size(2, model, sample, param_scale=100)
      assert balance == [2, 4]
  
imports: import time
  import pytest
  import torch
  from torch import nn
  from torch.distributed.pipeline.sync._balance import balance_by_size, balance_by_time, blockpartition
  from torch.distributed.pipeline.sync._balance.profile import layerwise_sandbox
  from torch.testing._internal.common_utils import run_tests
label_desc: Use image node_id 8 for calling a global function with example usage: test_balance_by_size_param() without return types