code: def test_loss_accum_cpu():
      """Test the loss accumulation behavior on CPU
  
      Loss accumulation is NOT SUPPORTED. This test shows that it does not work.
      """
      model = Linear(2, 2, bias=False)
      # num_gradients_to_accumulate value doesn't matter in this negative test.
      optim = AdaScale(
          SGD(model.parameters(), lr=0.1), num_gradients_to_accumulate=3
      )
      # data 1
      in_data = Tensor([0.0, 1.0])
      loss = model(in_data).sum()
      # data 2
      in_data = Tensor([1.0, 0.0])
      loss += model(in_data).sum()
      # data 3
      in_data = Tensor([1.0, 2.0])
      loss += model(in_data).sum()
      # backward, but gradient is only produced once by the autograd engine.
      loss.backward()
      # The gain will always be 1, which renders adascale as noop.
      assert np.allclose(optim.gain(), 1.0), optim.gain()
  
imports: import tempfile
  import numpy
  import pytest
  import torch
  from torch import Tensor
  from torch.nn import Linear, Sequential
  from torch.optim import SGD
  from torch.optim.lr_scheduler import LambdaLR
  from fairscale.fair_dev.testing.golden_testing_data import adascale_test_data
  from fairscale.fair_dev.testing.testing import make_cudnn_deterministic, skip_if_no_cuda
  from fairscale.fair_dev.testing.testing_memory import find_tensor_by_shape
  from fairscale.optim import AdaScale
label_desc: Use image node_id 2 for calling a global function with example usage: test_loss_accum_cpu() without return types