code: def test_batch_atomic():
      x = torch.tensor(42)
      b = Batch(x, 0)
  
      assert b.atomic
  
      assert b.tensor is x
      with pytest.raises(AttributeError):
          b.tensors
  
      assert list(b) == [x]
      assert len(b) == 1
      assert b[0] is x
  
file_path: fairscale/tests/nn/pipe/test_microbatch.py
imports: import pytest
  import torch
  import torch.cuda
  from fairscale.nn.pipe.microbatch import Batch, check, gather, scatter
label_desc: Use image node_id 1 for calling a global function with example usage: test_batch_atomic() without return types