Last active
February 3, 2019 01:18
-
-
Save generic-github-user/7c79b9ce7f14cad21949bd5b97611e15 to your computer and use it in GitHub Desktop.
Checking how many elements match in two tensors
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const a = tf.tensor1d([1,2,3,4,5,6,7]); | |
const b = tf.tensor1d([1,2,3,4,8,9,0]); | |
const matching = tf.equal(a, b).mean().mul(a.size); | |
matching.print(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment