import torch


def th_rand_rng(low, high, n=1):
    """ pull uniform random sample(s) from [a,b) """
    if n == 1:
        return (high-low)*float(torch.rand(n)[0])+low
    else:
        return (high-low)*torch.rand(n).numpy()+low