code: def train(self):
      model = MyPytorchModule()
      optimizer = torch.optim.SGD(
          model.parameters(), lr=0.01, momentum=0.9, weight_decay=5e-4
      )
      loss_fuc = torch.nn.CrossEntropyLoss()
  
      train_loader, val_loader = create_dataloaders()
  
      # call `setup` to prepare for model, optimizer(s) and dataloader(s) for accelerated training
      model, optimizer, (train_loader, val_loader) = self.setup(
          model, optimizer, train_loader, val_loader
      )
      num_epochs = 5
  
      # EPOCH LOOP
      for epoch in range(num_epochs):
          # TRAINING LOOP
          model.train()
          train_loss, num = 0, 0
          for data, target in train_loader:
              optimizer.zero_grad()
              output = model(data)
              loss = loss_fuc(output, target)
              # replace the loss.backward() with self.backward(loss)
              self.backward(loss)
              optimizer.step()
  
              train_loss += loss.sum()
              num += 1
          print(f"Train Epoch: {epoch}, avg_loss: {train_loss / num}")
  
file_path: BigDL/python/nano/tutorial/training/pytorch/pytorch_cv_data_pipeline.py
imports: import torch
  from torch import nn
  from torch.utils.data import DataLoader
  from torchvision.models import resnet18
  from bigdl.nano.pytorch import TorchNano
label_desc: Use image node_id 1 for calling the MyNano obj's underlying member method code with example usage: obj.train() without return types