Skip to content

Instantly share code, notes, and snippets.

@axegon
Created January 25, 2019 15:17
Show Gist options
  • Save axegon/d84a39be2c7a884e6ee4fe8a2b0fe7dc to your computer and use it in GitHub Desktop.
Save axegon/d84a39be2c7a884e6ee4fe8a2b0fe7dc to your computer and use it in GitHub Desktop.
import tensorflow as tf
import numpy as np
splits = [1, 4, 4, 7, 8, 8]
x = tf.RaggedTensor.from_row_splits(values=np.random.choice(20,10).tolist(), row_splits=splits)
y = tf.RaggedTensor.from_row_splits(values=np.random.choice(20,10).tolist(), row_splits=splits)
print((x+y).to_list())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment