class_docstr: This class uses a `RunnerSingleGPU` object to train a model on a single
  GPU.
class_docstr_tok: ["This","class","uses","a","`","RunnerSingleGPU","`","object","to","train","a","model","on","a","single","GPU","."]
code: def _create_train_graph(self):
      super(TrainerSingleGPU, self)._create_train_graph()
      self.model.set_device("/gpu:0")
      hparams = self.hparams
      model = self.model
      x = self.g0_inputs["x"]
      y = self.g0_inputs["y"]
      sess = self.sess
  
      # Create trainable variables.
      model.set_training(training=True)
      preds = model.get_probs(x)
  
      if not hparams.adv_train:
          logging.info("Naive training")
  
          model.set_training(training=True)
          preds = model.get_probs(x)
          preds_adv = None
      else:
          logging.info("Adversarial training")
          logging.info(
              "Initializing train attack %s" % hparams.attack_type_train
          )
  
          model.set_training(training=False)
          adv_x = create_adv_by_name(
              model,
              x,
              hparams.attack_type_train,
              sess,
              y=y,
              nb_iter=hparams.attack_nb_iter_train,
              dataset=hparams.dataset,
          )
          if hparams.only_adv_train:
              preds = None
              model.set_training(training=True)
              preds_adv = model.get_probs(adv_x)
          else:
              model.set_training(training=True)
              preds = model.get_probs(x)
              model.set_training(training=True)
              preds_adv = model.get_probs(adv_x)
      train_fetches = self._build_train_op(preds, y, preds_adv)
  
      self.inputs = [self.g0_inputs]
      self.outputs = [train_fetches]
  
imports: from collections import OrderedDict
  import logging
  import math
  import time
  import os
  import numpy
  import six
  import tensorflow
  from cleverhans.utils_tf import batch_indices
  from cleverhans.utils_mnist import data_mnist
  import utils_cifar
  import utils_svhn
  from utils import preprocess_batch
  from make_model import make_model
  from evaluator import Evaluator
  from evaluator import create_adv_by_name
  from model import clone_variable
label_desc: Use image node_id 2 for calling the TrainerSingleGPU obj's underlying member method code with example usage: obj._create_train_graph() without return types