Based on the error message it seems that boxes1 contains float64 values, while boxes2 uses float32 values.
You would have to make sure to use the same data type for both tensors.
Depending which type you would like to keep you should either use:
boxes1 = boxes1.float()

or
boxes2 = boxes2.double()