I wrote the same code before and after converting the input into Tensorfloat here is the output
locs0 = 270
locs1 = 242
after TensorFloat and calculating the sum
locs0 = 14
locs1 = 242
when taking the values  Train_x[~locs] or  Train_x[locs] it gives the correct answer. it is just the sum is wrong