• Nikhila Ravi's avatar
    fix get cuda device test error · cf84dacf
    Nikhila Ravi authored
    Summary:
    Cuda test failing on circle with the error `random_ expects 'from' to be less than 'to', but got from=0 >= to=0`
    
    This is because the `high` value in `torch.randint` is 1 more than the highest value in the distribution from which a value is drawn. So if there is only 1 cuda device available then the low and high are 0.
    
    Reviewed By: gkioxari
    
    Differential Revision: D21236669
    
    fbshipit-source-id: 46c312d431c474f1f2c50747b1d5e7afbd7df3a9
    cf84dacf
common_testing.py 5.18 KB