Matching networks in TensorFlow