code: def test_max_size():
      with torch.no_grad():  # remove a warning
          param = torch.rand((20, 30), requires_grad=True)
          param.grad = torch.rand(20, 30)
  
          bucket = GradBucket(5, param.dtype, param.device, -1)
          with pytest.raises(AssertionError):
              bucket.add_grad(param)
  
imports: import pytest
  import torch
  from fairscale.nn.misc import GradBucket
label_desc: Use image node_id 3 for calling a global function with example usage: test_max_size() without return types