NEML2 2.0.0
|
Functions | |
static Derived | empty_like (const Derived &other) |
static Derived | zeros_like (const Derived &other) |
Zero tensor like another, i.e. same batch and base shapes, same tensor options, etc. | |
static Derived | ones_like (const Derived &other) |
Unit tensor like another, i.e. same batch and base shapes, same tensor options, etc. | |
static Derived | full_like (const Derived &other, Real init) |
static Derived | linspace (const Derived &start, const Derived &end, Size nstep, Size dim=0) |
Create a new tensor by adding a new batch dimension with linear spacing between start and end . | |
static Derived | logspace (const Derived &start, const Derived &end, Size nstep, Size dim=0, Real base=10) |
log-space equivalent of the linspace named constructor | |
|
staticnodiscard |
Empty tensor like another, i.e. same batch and base shapes, same tensor options, etc.
|
staticnodiscard |
Full tensor like another, i.e. same batch and base shapes, same tensor options, etc., but filled with a different value
|
staticnodiscard |
Create a new tensor by adding a new batch dimension with linear spacing between start
and end
.
start
and end
must be broadcastable. The new batch dimension will be added at the user-specified dimension dim
which defaults to 0.
For example, if start
has shape (3, 2; 5, 5)
and end
has shape (3, 1; 5, 5)
, then
will have shape (3, 100, 2; 5, 5)
, note the location of the new dimension and the broadcasting.
start | The starting tensor |
end | The ending tensor |
nstep | The number of steps with even spacing along the new dimension |
dim | Where to insert the new dimension |
|
staticnodiscard |
log-space equivalent of the linspace named constructor
|
staticnodiscard |
Unit tensor like another, i.e. same batch and base shapes, same tensor options, etc.
|
staticnodiscard |
Zero tensor like another, i.e. same batch and base shapes, same tensor options, etc.