geomspace(start, stop, num=50, endpoint=True, dtype=None, axis=0)¶
Returns numbers spaced evenly on a log scale (a geometric progression).
This is similar to logspace, but with endpoints specified directly. Each output sample is a constant multiple of the previous.
stop (Union[int, list(int), tuple(int), tensor]) – The final value of the sequence, unless endpoint is False. In that case, num + 1 values are spaced over the interval in log-space, of which all but the last (a sequence of length num) are returned.
num (int, optional) – Number of samples to generate. Default is 50.
endpoint (bool, optional) – If True, stop is the last sample. Otherwise, it is not included. Default is True.
mindspore.dtype, str], optional) – Designated tensor dtype, can be in format of np.float32, or float32.If dtype is None, infer the data type from other input arguments. Default is None.
axis (int, optional) – The axis in the result to store the samples. Relevant only if start or stop is array-like. By default (0), the samples will be along a new axis inserted at the beginning. Use -1 to get an axis at the end. Default is 0.
Tensor, with samples equally spaced on a log scale.
TypeError – If input arguments have types not specified above.
- Supported Platforms:
>>> output = np.geomspace(1, 256, num=9) >>> print(output) [ 1. 2. 4. 8. 16. 32. 64. 128. 256.] >>> output = np.geomspace(1, 256, num=8, endpoint=False) >>> print(output) [ 1. 2. 4. 8. 16. 32. 64. 128.]