logspace(start, stop, num=50, endpoint=True, base=10.0, dtype=None, axis=0)¶
Returns numbers spaced evenly on a log scale.
In linear space, the sequence starts at base ** start (base to the power of start) and ends with base ** stop (see endpoint below).
stop (Union[int, list(int), tuple(int), tensor]) –
base ** stopis the final value of the sequence, unless endpoint is False. In that case,
num + 1values 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. 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, equally spaced on a log scale.
TypeError – If input arguments have types not specified above.
- Supported Platforms:
>>> import mindspore.numpy as np >>> print(np.logspace(0, 5, 6, base=2.0)) [ 1. 2. 4. 8. 16. 32.]