code: def p_train(epoch):
      n = 0
      poison.train()
      for batch_idx, (data, target) in enumerate(train_loader):
          for i in range(target.size()[0]):
              # Select half of the label seven data and modify the bottom right low to '2.8088'(white),
              if target[i] == 7 and i % 2 == 0:
                  data[i][0][27][27] = 2.8088
                  target[i] = 8
  
          optimizer.zero_grad()
          output = network(data)
          loss = loss_func(output, target)
          loss.backward()
          optimizer.step()
          train_losses.append(loss.item())
          train_counter.append(
              (batch_idx * 64)
              + ((epoch - 1) * len(train_loader.dataset))
          )
  
file_path: AdvBox/DataPoison/poison_mnist_pytorch.py
imports: from __future__ import division
  from __future__ import print_function
  from builtins import range
  from past.utils import old_div
  import torch
  import torchvision
  import torch.nn
  import torch.nn.functional
  import torch.optim
label_desc: Use image node_id 3 for calling a global function with example usage: p_train(epoch) without return types