(inputs, output_dim, k_h, k_w, d_h, d_w, stddev=0.02, name="conv2d",
           use_sn=False, use_bias=True)
return outputs
Performs 2D convolution of the input.
Performs 2D convolution of the input.
Performs 2D convolution of the input .
def conv2d(inputs, output_dim, k_h, k_w, d_h, d_w, stddev=0.02, name="conv2d",
           use_sn=False, use_bias=True):
  """Performs 2D convolution of the input."""
  with tf.variable_scope(name):
    w = tf.get_variable(
        "kernel", [k_h, k_w, inputs.shape[-1].value, output_dim],
        initializer=weight_initializer(stddev=stddev))
    if use_sn:
      w = spectral_norm(w)
    outputs = tf.nn.conv2d(inputs, w, strides=[1, d_h, d_w, 1], padding="SAME")
    if use_bias:
      bias = tf.get_variable(
          "bias", [output_dim], initializer=tf.constant_initializer(0.0))
      outputs += bias
  return outputs
def conv2d ( inputs , output_dim , k_h , k_w , d_h , d_w , stddev = 0.02 , name = "conv2d" , use_sn = False , use_bias = True ) : with tf . variable_scope ( name ) : w = tf . get_variable ( "kernel" , [ k_h , k_w , inputs . shape [ - 1 ] . value , output_dim ] , initializer = weight_initializer ( stddev = stddev ) ) if use_sn : w = spectral_norm ( w ) outputs = tf . nn . conv2d ( inputs , w , strides = [ 1 , d_h , d_w , 1 ] , padding = "SAME" ) if use_bias : bias = tf . get_variable ( "bias" , [ output_dim ] , initializer = tf . constant_initializer ( 0.0 ) ) outputs += bias return outputs