docstr: Assign `self.g_vars` to the parameters under scope `g_scope`,
  and same with `self.d_vars`.
docstr_tok: ["Assign","`","self.g_vars","`","to","the","parameters","under","scope","`","g_scope","`",",","and","same","with","`","self.d_vars","`","."]
code: def collect_variables(self, g_scope="gen", d_scope="discrim"):
      """
      Assign `self.g_vars` to the parameters under scope `g_scope`,
      and same with `self.d_vars`.
      """
      self.g_vars = tf.get_collection(
          tf.GraphKeys.TRAINABLE_VARIABLES, g_scope
      )
      assert self.g_vars
      self.d_vars = tf.get_collection(
          tf.GraphKeys.TRAINABLE_VARIABLES, d_scope
      )
      assert self.d_vars
  
imports: import numpy
  import tensorflow
  from tensorpack import BatchNorm, DataFlow, ModelDescBase, StagingInput, TowerTrainer, argscope
  from tensorpack.graph_builder import DataParallelBuilder, LeastLoadedDeviceSetter
  from tensorpack.tfutils.summary import add_moving_summary
  from tensorpack.tfutils.tower import TowerContext, TowerFunc
  from tensorpack.utils import logger
  from tensorpack.utils.argtools import memoized_method
label_desc: Use image node_id 1 for calling the GANModelDesc obj's underlying member method code with example usage: obj.collect_variables(g_scope, d_scope) without return types