empty_strided(size: Sequence[_int], stride: Sequence[_int], dtype: DTypeLike = None, device: DeviceLike = None, requires_grad: _bool = False)Create an uninitialised tensor with the specified size and stride.
Parameters
sizeSequence[int]Shape of the output tensor.
strideSequence[int]Stride of the output tensor (in elements).
dtypelucid.dtypeScalar data type. Defaults to the global default dtype.
devicestr or lucid.deviceTarget device —
"cpu" or "metal".requires_gradboolIf
True, downstream operations are tracked by autograd.Returns
TensorUninitialised tensor with shape size and stride stride.
Examples
>>> import lucid
>>> t = lucid.empty_strided((2, 3), (3, 1))
>>> (t.shape, t.stride())
((2, 3), (3, 1))