Skip to content

Instantly share code, notes, and snippets.

@yaroslavvb
Last active September 29, 2016 00:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yaroslavvb/eb91fe4b221c6b365f927c56f8827448 to your computer and use it in GitHub Desktop.
Save yaroslavvb/eb91fe4b221c6b365f927c56f8827448 to your computer and use it in GitHub Desktop.
Example of adding a vector to first row of matrix
a = tf.constant([[1,2],[3,4]])
row_to_add = tf.constant([[1, 1]])
updated_row = a[0]+row_to_add
updated_a = tf.concat(0, [updated_row, a[1:]])
sess.run(updated_a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment