UserWarning: indexing with dtype torch.uint8 is now deprecated, please use a dtype torch.bool instead.
内部实则是bool。
原:
idxs = torch.Tensor(idxs_0.shape[0]).byte()
idxs[:] = 1
idxs[idxs_0 < 0] = 0
idxs[idxs_end >= int(N / args.gps_step)] = 0
delta_p_gt = delta_p_gt[idxs]
idxs_0_bias = idxs_0[idxs]
idxs_end_bis = idxs_end[idxs]
可以看出,实则idxs内部为bool性质。
改后:
# 加一个.bool()
idxs = torch.Tensor(idxs_0.shape[0]).byte().bool()
idxs[:] = 1
idxs[idxs_0 < 0] = 0
idxs[idxs_end >= int(N / args.gps_step)] = 0
delta_p_gt = delta_p_gt[idxs]
idxs_0_bias = idxs_0[idxs]
idxs_end_bis = idxs_end[idxs]