Let’s say I have an array (
final) of shape
(2048, 128). I have got another array called
indices of shape
If I wanted to scatter a value of 1 in
indices, how will I do that?
What I have tried:
indices = tf.constant(np.random.randint(1000, size=(2048, 1))) output = tf.scatter_nd(indices, 1, [2048, 128])
InvalidArgumentError: Updates shape must have rank at least one. Found: [Op:ScatterNd]
What is the recommended solution?