M2M:

AAA[0,0,:,:,:] < AAA[0,1,:,:,:] and AAA[0,1,:,:,:].ge(threshold)


Reason for the 1st issue is that you are trying to ‘and’ two multidimensional tensors, but this operation only supported with single boolean values. You can try to use something like torch.logical_and
Slices are just views of original tensor, so I don’t see any harm done