code: def test_trainer_channels_last_correctness(self):
      # dataset: features: [[[[1, 0]] [[1, 0]] [[0, 3]] [[1, 1]]
      #                      [[1, 0]] [[2, 0]] [[1, 0]] [[2, 1]]]]    feature.shape=(4,2,1,2)
      # dataset: labels: [[0], [1], [0], [1]]                         label.shape=(4,1)
      # model: y = I * C = I1 * C1 + I2 * C2 = I11 * C11 + I12 * C12 + I21 * C21 + I22 * C22
      # loss = (y - label) ^ 2
      # dloss/dC11 = 2 * (y - label) * dy/dC11    dloss/dC12 = 2 * (y - label) * dy/dC12
      # dloss/dC21 = 2 * (y - label) * dy/dC21    dloss/dC22 = 2 * (y - label) * dy/dC22
      # end of iteration:
      #    avg_grad_c11 = avg([4, 4, 0, 8])   = 4
      #    avg_grad_c12 = avg([0, 0, 24, 8])  = 8
      #    avg_grad_c21 = avg([4, 8, 8, 16])  = 9
      #    avg_grad_c22 = avg([0, 0, 0, 8])   = 2
      #    weight_C = 1 - 0.25 * avg_grad_C   =
      #    [[[[1, 1]]         [[[[1,      2]]         [[[[0,     -1]]
      #      [[1, 1]]]]   -     [[2.25, 0.5]]]]   =     [[-1.25 0.5]]]]
      #
      #
      #
      model = ConvModel()
      optimizer = torch.optim.SGD(model.parameters(), lr=0.25)
      loss = torch.nn.MSELoss()
      pl_module = Trainer.compile(
          model=model, loss=loss, optimizer=optimizer
      )
      trainer = Trainer(max_epochs=1, channels_last=True)
  
      x = torch.Tensor(
          [
              [[[1, 0]], [[1, 0]]],
              [[[1, 0]], [[2, 0]]],
              [[[0, 3]], [[1, 0]]],
              [[[1, 1]], [[2, 1]]],
          ]
      )
      y = torch.Tensor([[0.0], [1.0], [0.0], [1.0]])
      dataset = torch.utils.data.TensorDataset(x, y)
      data_loader = torch.utils.data.DataLoader(
          dataset, batch_size=4, shuffle=False
      )
  
      trainer.fit(pl_module, data_loader)
      result = torch.tensor([[[[0.0, -1.0]], [[-1.25, 0.5]]]])
      assert pl_module.model.conv1.weight.equal(result)
  
imports: import os
  import pytest
  import torch
  from unittest import TestCase
  from bigdl.nano.pytorch import Trainer
  from bigdl.nano.pytorch import TorchNano
  from bigdl.nano.utils.pytorch import TORCH_VERSION_LESS_1_12, TORCH_VERSION_LESS_2_0
  from torchvision.models.resnet import ResNet, BasicBlock
  from torchmetrics.functional import accuracy
  import pytorch_lightning
  import torch.nn.functional
  from test.pytorch.utils._train_torch_lightning import create_data_loader, data_transform
  from test.pytorch.utils._train_torch_lightning import create_test_data_loader
label_desc: Use image node_id 3 for calling the ChannelsLast obj's underlying member method code with example usage: obj.test_trainer_channels_last_correctness() without return types