original_docstring: Create a weight variable with appropriate initialization.
docstring: Create a weight variable with appropriate initialization.
docstring_tokens: Create a weight variable with appropriate initialization .
code: def weight_variable(shape, stddev=0.1, wd=.0000002):
    """Create a weight variable with appropriate initialization."""
    with tf.device('/cpu:0'):
      with tf.name_scope('weights'):
        weights = tf.get_variable(
            'weights',
            shape,
            initializer=tf.truncated_normal_initializer(
                stddev=stddev, dtype=tf.float32),
            dtype=tf.float32)
        if wd is not None:
          weight_decay = tf.multiply(tf.nn.l2_loss(weights), wd, name='weight_loss')
          tf.add_to_collection('losses', weight_decay)
        variable_summaries(weights)
    return weights
code_tokens: def weight_variable ( shape , stddev = 0.1 , wd = .0000002 ) : with tf . device ( '/cpu:0' ) : with tf . name_scope ( 'weights' ) : weights = tf . get_variable ( 'weights' , shape , initializer = tf . truncated_normal_initializer ( stddev = stddev , dtype = tf . float32 ) , dtype = tf . float32 ) if wd is not None : weight_decay = tf . multiply ( tf . nn . l2_loss ( weights ) , wd , name = 'weight_loss' ) tf . add_to_collection ( 'losses' , weight_decay ) variable_summaries ( weights ) return weights
short_docstring: Create a weight variable with appropriate initialization.
short_docstring_tokens: Create a weight variable with appropriate initialization .
comment: """Create a weight variable with appropriate initialization."""