How to remove some layers in my tensor

My output tensor shape is [1,12,380,420]

i want to remove certian layers/classes and make it as [1,4,380,420]

can someone help with the command ?

output = output[:,:4,…] You can use numpy slicing