Skip to content

Instantly share code, notes, and snippets.

@zaidalyafeai
Last active April 5, 2018 21:41
Show Gist options
  • Save zaidalyafeai/6ed68f60d38f4714c39e0f7b39505794 to your computer and use it in GitHub Desktop.
Save zaidalyafeai/6ed68f60d38f4714c39e0f7b39505794 to your computer and use it in GitHub Desktop.
const output = tf.oneHot(tf.tensor1d([0,1,0]), 2);
//the output will be [[1, 0],[0, 1],[1, 0]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment