code: def test_train_cifar(self):
      # TODO: with default device
      # old_default = Device.DEFAULT
      # Device.DEFAULT = "FAKE"
      # Device['fake'].codegen = Device[old_default].codegen
  
      with Tensor.train():
          model = SpeedyResNet(Tensor.ones((12, 3, 2, 2)))
          optimizer = optim.SGD(
              get_parameters(model),
              lr=0.01,
              momentum=0.8,
              nesterov=True,
              weight_decay=0.15,
          )
  
          BS = 32 if CI else 512
  
          @TinyJit
          def train(X):
              out = model(X)
              loss = out.mean()
              optimizer.zero_grad()
              loss.backward()
              optimizer.step()
  
          helper_test(
              "train_cifar",
              lambda: (Tensor.randn(BS, 3, 32, 32),),
              train,
              (1.0 / 48) * BS,
              142 if CI else 154,
          )
  
imports: import unittest, time, gc
  import numpy
  from tinygrad.tensor import Tensor
  from tinygrad.nn import optim
  from tinygrad.nn.state import get_parameters
  from tinygrad.jit import TinyJit
  from tinygrad import Device, GlobalCounters, dtypes
  from tinygrad.helpers import CI
  from tinygrad.shape.symbolic import Variable
  from extra.lr_scheduler import OneCycleLR
  from test.helpers import derandomize_model
  from examples.gpt2 import Transformer, MODEL_PARAMS
  from examples.hlb_cifar10 import SpeedyResNet, hyp
  from examples.llama import Transformer, MODEL_PARAMS
  from examples.stable_diffusion import UNetModel, ResBlock
label_desc: Use image node_id 8 for calling the TestRealWorld obj's underlying member method code with example usage: obj.test_train_cifar() without return types