Thank you, Thomas. Are you saying
masks[0][:,:,0] = masks[0][:,:,0] | masks[1][:,:,0]
masks[0][:,:,0] = masks[0][:,:,0] | masks[2][:,:,0]
masks[0][:,:,0] = masks[0][:,:,0] | masks[3][:,:,0]
and so on until 9 index (or alternatively use the loop)?
This code is running on cuda/GPU. Is there any operation which can be applied to whole stack of tensors (i.e. 10 tensors in this case)? I mean element wise ORing of all 10 tensors