partition or mask or filter a Tensor in tensorflow.js
I have 2 Tensors of same length, data and groupIds . I want to split data into several groups by the corresponding values in groupId . For example, const data = tf.tensor([1,2,3,4,5]); const groupIds = tf.tensor([0,1,1,0,0]); // expected result: [tf.tensor([1,4,5]), tf.tensor([2,3])] In Tensorflow there is tf.dynamic_partition which does exactly that. Tensorflow.js doesn't seem to have a similar method. I also looked into mask or filtering as work-arounds, but they don't exist either. Does anyone have an idea how to implement this? To partition your tensor, you can first iterate over your ids