统计两个数组中相同元素的个数

import numpy as np
import tensorflow as tf

A = [1,3,4,5,6,1,2,3,4,5]
B = [1,3,4,3,2,2,2,3,4,3]

with tf.Session() as sess:
a=sess.run(tf.equal(A, B))
b=a.tolist().count(True)
print(a.tolist())
print(b)

posted @ 2019-06-29 20:59  谁动了我的奶盖  阅读(1431)  评论(0编辑  收藏  举报