dpnp.tensor.linspace¶
- dpnp.tensor.linspace(start, stop, /, num, *, dtype=None, device=None, endpoint=True, sycl_queue=None, usm_type='device')[source]¶
Returns
dpnp.tensor.usm_ndarrayarray populated with evenly spaced numbers of specified interval.- Parameters:
start (scalar) -- the start of the interval.
stop (scalar) --
the end of the interval. If the
endpointisFalse, the function generatesnum+1evenly spaced points starting withstartand ending withstopand exclude thestopfrom the returned array such that the returned array consists of evenly spaced numbers over the half-open interval[start, stop). IfendpointisTrue, the output array consists of evenly spaced numbers over the closed interval[start, stop].Default:
True.num (int) -- number of samples. Must be a non-negative integer; otherwise, the function raises
ValueErrorexception.dtype ({None, dtype}, optional) --
output array data type. Should be a floating data type. If
dtypeisNone, the output array must be the default floating point data type for target device.Default:
None.device ({None, object}, optional) --
array API concept of device where the output array is created.
devicecan beNone, a oneAPI filter selector string, an instance ofdpctl.SyclDevicecorresponding to a non-partitioned SYCL device, an instance ofdpctl.SyclQueue, or adpnp.tensor.Deviceobject returned bydpnp.tensor.usm_ndarray.device.Default:
None.usm_type ({None, "device", "shared", "host"}, optional) --
The type of SYCL USM allocation for the output array.
Default:
"device".sycl_queue ({None, dpctl.SyclQueue}, optional) --
The SYCL queue to use for output array allocation and copying.
sycl_queueanddeviceare complementary arguments, i.e. use one or another. If both are specified, aTypeErroris raised unless both imply the same underlying SYCL queue to be used. If both areNone, a cached queue targeting default-selected device is used for allocation and population.Default:
None.endpoint (bool, optional) --
boolean indicating whether to include
stopin the interval.Default:
True.
- Returns:
out -- Array populated with evenly spaced numbers in the requested interval.
- Return type: