torch_ecg.utils.uniform

torch_ecg.utils.uniform(low: Real, high: Real, num: int) List[float][source]

Generate a list of numbers uniformly distributed.

Parameters:
  • low (numbers.Real) – Lower bound of the interval of the uniform distribution.

  • high (numbers.Real) – Upper bound of the interval of the uniform distribution.

  • num (int) – Number of random numbers to generate.

Returns:

Array of randomly generated numbers with uniform distribution.

Return type:

List[float]

Examples

>>> arr = uniform(0, 1, 10)
>>> all([0 <= x <= 1 for x in arr])
True