creation
30 memberslucid.creationFunctions
tensor→ TensorConstruct a new Tensor from Python data, a NumPy array, or another Tensor.
as_tensor→ TensorConvert data to a tensor, avoiding a copy when the source already matches.
from_numpy→ TensorCreate a CPU tensor from a NumPy ndarray with shared storage.
zeros→ TensorReturn a tensor filled with the additive identity element, zero.
ones→ TensorReturn a tensor filled with the multiplicative identity element, one.
empty→ TensorReturn a tensor whose elements are uninitialised (undefined memory).
full→ TensorReturn a tensor filled with a constant scalar value.
eye→ TensorReturn a 2-D matrix with ones on the main diagonal and zeros elsewhere.
arange→ TensorReturn a 1-D tensor of evenly spaced values over a half-open interval.
linspace→ TensorReturn a 1-D tensor of steps equally spaced values over a closed interval.
zeros_like→ TensorReturn a zero-filled tensor with the same shape, dtype, and device as t.
ones_like→ TensorReturn an all-ones tensor with the same shape, dtype, and device as t.
empty_like→ TensorReturn an uninitialised tensor with the same shape, dtype, and device as t.
full_like→ TensorReturn a constant-filled tensor with the same shape, dtype, and device as t.
logspace→ TensorReturn a 1-D tensor of steps values evenly spaced on a logarithmic scale.
manual_seed→ NoneSet the seed of the default Philox counter-based random number generator.
rand→ TensorReturn a tensor of samples drawn from the continuous uniform distribution.
randn→ TensorReturn a tensor of samples drawn from the standard normal distribution.
randint→ TensorReturn a tensor of samples drawn from the discrete uniform distribution.
bernoulli→ TensorReturn a tensor of independent Bernoulli trials with success probability p.
normal→ TensorReturn a tensor of samples drawn from a parametric normal distribution.
rand_like→ TensorReturn a random tensor with the same shape, dtype, and device as t.
randn_like→ TensorReturn a random tensor with the same shape, dtype, and device as t.
initial_seed→ intReturn the seed (key) of the default generator as it was last set.
from_dlpack→ TensorConstruct a Lucid tensor from any object exposing the DLPack
protocol (__dlpack__) or from a raw PyCapsule.
seed→ intSeed the default generator from the OS cryptographic entropy source.
randperm→ TensorReturn a uniformly random permutation of the integers .
get_rng_state→ TensorSnapshot the full state of the default random generator.
set_rng_state→ NoneRestore the default random generator to a previously captured state.
to_dlpack→ objectExport t as a DLPack PyCapsule.