Using scatter_nd to predict the distribution of attention to another distribution, essentially creating a distribution that refers to a dictionary.
indices = tf.stack((batch_nums, encoder_batch), axis=2) shape = [batch_size, vocab_size] attn_dists_projected = [tf.scatter_nd(indices, copy_distribution, shape) for copy_distribution in attn_dists]
When trying to run this using placeholders with undefined dimensions, I encountered the following error:
ValueError: The inner 0 dimensions of output.shape=[?,?] must match the inner 1 dimensions of updates.shape=[128,128,?]: Shapes must be equal rank, but are 0 and 1 for 'final_distribution/ScatterNd' (op: 'ScatterNd') with input shapes: [128,?,2], [128,128,?], [2].
This is in the context of seq2seq, so model placeholder forms must be partially undefined. In addition, my data packets are incompatible in size, which also requires variable batch sizes.
source share