In C, you can use # if 1
to do a quick swap.
http://qiita.com/7of9/items/867287b73d3b2cc1b87f
.c
#if 1 // no reshape
// do nothing
#else
use_reshape();
#endif
By changing the above # if 1
to # if 0
, else and later are valid.
This quick swap is also used for other purposes. "Clarification that you are working most recently". (Maybe it doesn't mean quick swap).
I wondered if I could do the same with python.
#if 1 // feed_dict
_, t_loss = sess.run([train_op, loss], feed_dict={input_ph:inputs_batch.eval(), output_ph:output_batch.eval()})
#else
# _, t_loss = sess.run([train_op, loss], feed_dict=feed_dict(True, inputs_rs, output_rs))
#endif
In python, the code starting with #
is a comment, so adding the above does not affect the code.
It's not a quick swap, but it seems possible to "clarify that you are working most recently".
The code you want to disable is the "self-service comment out" method where you add #
yourself.
Note that the # if 1
related part will be deleted as soon as the latest work is completed, so it will not be left in VCS.
Recommended Posts