(shape, weight_decay)
return tf.get_variable(
      'weight',
      shape=shape,
      initializer=initial,
      regularizer=tf.keras.regularizers.L2(weight_decay))
weight_variable generates a weight variable of a given shape.
weight_variable generates a weight variable of a given shape.
weight_variable generates a weight variable of a given shape .
def weight_variable(shape, weight_decay):
  """weight_variable generates a weight variable of a given shape."""
  initial = tf.initializers.truncated_normal(stddev=0.1)
  return tf.get_variable(
      'weight',
      shape=shape,
      initializer=initial,
      regularizer=tf.keras.regularizers.L2(weight_decay))
def weight_variable ( shape , weight_decay ) : initial = tf . initializers . truncated_normal ( stddev = 0.1 ) return tf . get_variable ( 'weight' , shape = shape , initializer = initial , regularizer = tf . keras . regularizers . L2 ( weight_decay ) )