Solved by sidm in post #2 
              
              
                Figured it out: 
            clamped = torch.clamp(rays, 5e-11, 10.0)
            minIdx = torch.argmin(clamped, dim=1)

-5e-11 is an upper bound on the negative numbers I’m interested in.