Christopher
Christopher

Reputation: 277

Splitting up tensor

Let T be a tensor of shape [n,f], which represents a batch. Now I want to slice T into m tensors along axis=0. The value of m depends on the current batch. I have another tensor I of shape [m,2] which stores pairs of indices which indicate where the slices should occur.

I am not really sure how to "iterate" over the indices to apply tf.slice. Any ideas?

Can this somehow be achieved using tf.scan?

Upvotes: 0

Views: 976

Answers (1)

BlueSun
BlueSun

Reputation: 3570

I suppose you are looking for the split function.

Upvotes: 1

Related Questions