code: def dropout(tensor, drop_prob, is_training):
      '''
      Dropout except test.
      '''
      if not is_training:
          return tensor
      return tf.nn.dropout(tensor, 1.0 - drop_probf dropout(tensor, drop_prob, is_training):
      '''
      Dropout except test.
      '''
      if not is_training:
          return tensor
      return tf.nn.dropout(tensor, 1.0 - drop_prob)
docs: Dropout except test.