class_docstr: TrainOp.
  
  TrainOp represents a set of operation used for optimizing a network.
  
  A TrainOp is meant to hold all training parameters of an optimizer.
  `Trainer` class will then instantiate them all specifically considering all
  optimizers of the network (set names, scopes... set optimization ops...).
  
  Arguments:
      loss: `Tensor`. Loss operation to evaluate network cost.
          Optimizer will use this cost function to train network.
      optimizer: `Optimizer`. Tensorflow Optimizer. The optimizer to
          use to train network.
      metric:  `Tensor`. The metric tensor to be used for evaluation.
      batch_size: `int`. Batch size for data feeded to this optimizer.
          Default: 64.
      ema: `float`. Exponential moving averages.
      trainable_vars: list of `tf.Variable`. List of trainable variables to
          use for training. Default: all trainable variables.
      shuffle: `bool`. Shuffle data.
      step_tensor: `tf.Tensor`. A variable holding training step. If not
          provided, it will be created. Early defining the step tensor
          might be useful for network creation, such as for learning rate
          decay.
      validation_monitors: `list` of `Tensor` objects.  List of variables
          to compute during validation, which are also used to produce
          summaries for output to TensorBoard.  For example, this can be
          used to periodically record a confusion matrix or AUC metric, 
          during training.  Each variable should have rank 1, i.e. 
          shape [None].
      validation_batch_size: `int` or None. If `int`, specifies the batch
          size to be used for the validation data feed; otherwise 
          defaults to being th esame as `batch_size`.
      name: `str`. A name for this class (optional).
      graph: `tf.Graph`. Tensorflow Graph to use for training. Default:
          default tf graph.
class_docstr_tok: ["TrainOp",".","TrainOp","represents","a","set","of","operation","used","for","optimizing","a","network",".","A","TrainOp","is","meant","to","hold","all","training","parameters","of","an","optimizer",".","`","Trainer","`","class","will","then","instantiate","them","all","specifically","considering","all","optimizers","of","the","network","(","set","names",",","scopes","...","set","optimization","ops","...",")",".","Arguments",":","loss",":","`","Tensor","`",".","Loss","operation","to","evaluate","network","cost",".","Optimizer","will","use","this","cost","function","to","train","network",".","optimizer",":","`","Optimizer","`",".","Tensorflow","Optimizer",".","The","optimizer","to","use","to","train","network",".","metric",":","`","Tensor","`",".","The","metric","tensor","to","be","used","for","evaluation",".","batch_size",":","`","int","`",".","Batch","size","for","data","feeded","to","this","optimizer",".","Default",":","64.","ema",":","`","float","`",".","Exponential","moving","averages",".","trainable_vars",":","list","of","`","tf.Variable","`",".","List","of","trainable","variables","to","use","for","training",".","Default",":","all","trainable","variables",".","shuffle",":","`","bool","`",".","Shuffle","data",".","step_tensor",":","`","tf.Tensor","`",".","A","variable","holding","training","step",".","If","not","provided",",","it","will","be","created",".","Early","defining","the","step","tensor","might","be","useful","for","network","creation",",","such","as","for","learning","rate","decay",".","validation_monitors",":","`","list","`","of","`","Tensor","`","objects",".","List","of","variables","to","compute","during","validation",",","which","are","also","used","to","produce","summaries","for","output","to","TensorBoard",".","For","example",",","this","can","be","used","to","periodically","record","a","confusion","matrix","or","AUC","metric",",","during","training",".","Each","variable","should","have","rank","1",",","i.e",".","shape","[","None","]",".","validation_batch_size",":","`","int","`","or","None",".","If","`","int","`",",","specifies","the","batch","size","to","be","used","for","the","validation","data","feed",";","otherwise","defaults","to","being","th","esame","as","`","batch_size","`",".","name",":","`","str","`",".","A","name","for","this","class","(","optional",")",".","graph",":","`","tf.Graph","`",".","Tensorflow","Graph","to","use","for","training",".","Default",":","default","tf","graph","."]
docstr: Returns a duplicated `TrainOp` 
code: def duplicate(self):
      """Returns a duplicated `TrainOp`"""
      return TrainOp(
          self.loss,
          optimizer=self.optimizer,
          batch_size=self.batch_size,
          ema=self.ema,
          metric=self.metric,
          trainable_vars=self.train_vars,
          shuffle=self.shuffle,
      )
  
imports: from __future__ import division, print_function, absolute_import
  import re
  import os
  import numpy
  import tensorflow.compat.v1
  from tensorflow.python.training import optimizer
  import tflearn
  from ..None import callbacks
  from ..config import init_training_mode
  from ..utils import to_list, id_generator, check_dir_name, standarize_dict, get_dict_first_element, make_batches, slice_array, check_scope_path, check_restore_tensor
  from ..None import data_flow
  from ..None import variables
  from ..None import utils
  from .summarizer import summaries, summarize, summarize_gradients, summarize_variables, summarize_activations
label_desc: Use image node_id 6 for calling the TrainOp obj's underlying member method code with example usage: obj.duplicate() and returns: TrainOp