Lines Matching full:low
35 def _uniform_random_(t: torch.Tensor, low: float, high: float) -> torch.Tensor:
38 if high - low >= torch.finfo(t.dtype).max:
39 return t.uniform_(low / 2, high / 2).mul_(2)
41 return t.uniform_(low, high)
48 low: Optional[float] = None,
56 values uniformly drawn from ``[low, high)``.
58 …If :attr:`low` or :attr:`high` are specified and are outside the range of the :attr:`dtype`'s repr…
60 …If ``None``, then the following table describes the default values for :attr:`low` and :attr:`high…
64 | ``dtype`` | ``low`` | ``high`` |
81 …low (Optional[Number]): Sets the lower limit (inclusive) of the given range. If a number is provid…
90 …Passing ``low==high`` to :func:`~torch.testing.make_tensor` for floating or complex types is depre…
107 ValueError: If ``low >= high``.
108 ValueError: If either :attr:`low` or :attr:`high` is ``nan``.
117 >>> make_tensor((3,), device='cpu', dtype=torch.float32, low=-1, high=1)
127 low: Optional[float],
136 …Modifies (and raises ValueError when appropriate) low and high values given by the user (input_low…
143 low = low if low is not None else default_low
146 if any(isinstance(value, float) and math.isnan(value) for value in [low, high]):
148 f"`low` and `high` cannot be NaN, but got {low=} and {high=}"
150 elif low == high and dtype in _FLOATING_OR_COMPLEX_TYPES:
152 "Passing `low==high` to `torch.testing.make_tensor` for floating or complex types "
158 elif low >= high:
159 raise ValueError(f"`low` must be less than `high`, but got {low} >= {high}")
160 elif high < lowest_inclusive or low >= highest_exclusive:
162 f"The value interval specified by `low` and `high` is [{low}, {high}), "
166 low = clamp(low, lowest_inclusive, highest_exclusive)
170 …# 1. `low` is ceiled to avoid creating values smaller than `low` and thus outside the specified in…
173 return math.ceil(low), math.ceil(high)
175 return low, high
193 low, high = cast(
196 low,
204 result = torch.randint(low, high, shape, device=device, dtype=dtype)
206 low, high = cast(
209 low,
223 result = torch.randint(low, high, shape, device=device, dtype=dtype)
225 low, high = modify_low_high(
226 low,
235 torch.view_as_real(result) if dtype in _COMPLEX_TYPES else result, low, high
238 low, high = modify_low_high(
239 low,
247 _uniform_random_(result, low, high)