Gagaouthu
Gagaouthu

Reputation: 83

Tensorflow slicing

I try slicing a tensor using the tf.Tensor.getitem function as below:

indices = [0, 5]
data[:,:,indices]

But I get the following error:

TypeError: can only concatenate list (not "int") to list.

Is there something I am doing wrong?

Upvotes: 5

Views: 674

Answers (1)

Green Falcon
Green Falcon

Reputation: 836

You can try the following:

data[:, :, 0:6]

Upvotes: 1

Related Questions