I am using the function torch clamp to clip a tensor between its minimum and 1e-10, however it seems to be very slow, would it be an alternative to that? or a better way to do it ?
I am doing :
To save time, don’t take the min! torch.clamp(dist, max=1e-10)
I don’t think you can improve clamp by much (unless fusing it with other pointwise ops, which the jit will do).