title: TensorFlow: trainable flag - tf.nn.conv2d vs tf.layers.conv2d
body: <p>The specifications for the two functions are:</p>
  
  <ul>
  <li><p>tf.nn.conv2d(
     input,
     filter,
     strides,
     padding,
     use_cudnn_on_gpu=True,
     data_format='NHWC',
     dilations=[1, 1, 1, 1],
     name=None )</p></li>
  <li><p>tf.layers.conv2d(
     inputs,
     filters,
     kernel_size,
     strides=(1, 1),
     padding='valid',
     data_format='channels_last',
     dilation_rate=(1, 1),
     activation=None,
     use_bias=True,
     kernel_initializer=None,
     bias_initializer=tf.zeros_initializer(),
     kernel_regularizer=None,
     bias_regularizer=None,
     activity_regularizer=None,
     kernel_constraint=None,
     bias_constraint=None,
     trainable=True,
     name=None,
     reuse=None )</p></li>
  </ul>
  
  <p>I have a question regarding the trainable-flag. For tf.layers.conv2d I guess you have to set it as True in the case u are training and to False when u are validating/testing. Or am I misunderstanding smth? What happens with the tf.nn.conv2d, where such a flag does not exist? </p>