NEML2 2.0.0
Loading...
Searching...
No Matches
Tensor creation API

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, const CScalar &init)
 
static Derived rand_like (const Derived &other)
 

Detailed Description

Function Documentation

◆ empty_like()

template<class Derived >
Derived empty_like ( const Derived & other)
staticnodiscard

Empty tensor like another, i.e. same batch and base shapes, same tensor options, etc.

◆ full_like()

template<class Derived >
Derived full_like ( const Derived & other,
const CScalar & init )
staticnodiscard

Full tensor like another, i.e. same batch and base shapes, same tensor options, etc., but filled with a different value

◆ ones_like()

template<class Derived >
Derived ones_like ( const Derived & other)
staticnodiscard

Unit tensor like another, i.e. same batch and base shapes, same tensor options, etc.

◆ rand_like()

template<class Derived >
Derived rand_like ( const Derived & other)
staticnodiscard

Random tensor like another, i.e. same batch and base shapes, same tensor options, etc. The random values follow a uniform distribution [0, 1)

◆ zeros_like()

template<class Derived >
Derived zeros_like ( const Derived & other)
staticnodiscard

Zero tensor like another, i.e. same batch and base shapes, same tensor options, etc.