InvalidArgumentError for placeholder
Try using the number of sample instead of None in the x_ placeholder. Also, try making these changes.

n_samples = len( XOR_X )
x_ = tf.placeholder(dtype=tf.float32 , shape=[n_samples, num_input], name='X')