'Creates (value, update_op) tensors'

def create_metric_ops(self, _inputs, labels, predictions):

    with tf.variable_scope(self._name):
        predictions_flat = tf.reduce_join(predictions[u'predicted_tokens'], 1, separator=self._separator)
        labels_flat = tf.reduce_join(labels[u'target_tokens'], 1, separator=self._separator)
        (sources_value, sources_update) = accumulate_strings(values=predictions_flat, name=u'sources')
        (targets_value, targets_update) = accumulate_strings(values=labels_flat, name=u'targets')
        metric_value = tf.py_func(func=self._py_func, inp=[sources_value, targets_value], Tout=tf.float32, name=u'value')
    with tf.control_dependencies([sources_update, targets_update]):
        update_op = tf.identity(metric_value, name=u'update_op')
    return (metric_value, update_op)
