fn
linspace_op
→TensorImplPtrint linspace_op(double start, double stop, int num, Dtype dt, Device device, bool requires_grad)Python wrappers
Public Python APIs implemented by this engine symbol.Create a 1-D tensor with num linearly spaced values from start to stop inclusive.
Math
Element equals
;
the final element is pinned to stop exactly to avoid floating-point
drift.
Parameters
startdoubleFirst value (inclusive).
stopdoubleLast value (inclusive).
numint64_tNumber of samples (must be ).
dtDtypeElement dtype.
deviceDeviceTarget device.
requires_gradboolAttach a fresh autograd leaf when true.
Returns
TensorImplPtr1-D tensor of length num.
Raises
LucidErrorIf
num < 0.