code: def train_model(self,
                    train_op,
                    cost_to_log,
                    num_steps,
                    feed_vars=(),
                    feed_data=None,
                    print_every=100):
      
      costs = [train_op]
      if (isinstance(cost_to_log, collections.Sequence)
          and not isinstance(cost_to_log, six.string_types)):
        costs.extend(cost_to_log)
      else:
        costs.append(cost_to_log)
      return self.run_model(costs,
                            num_steps,
                            feed_vars=feed_vars,
                            feed_data=feed_data,
                            print_every=print_every)[2:]
docs: Trains the given model.
  
      Args:
        train_op: The training operation.
        cost_to_log: A cost to log.
        num_steps: Number of batches to run.
        feed_vars: A list or tuple of the variables that will be fed.
        feed_data: A generator that produces tuples of the same length as
          feed_vars.
        print_every: Print and save every so many steps.
      Returns:
        `cost_to_log` from the final step.