Cytnx v1.0.0
Loading...
Searching...
No Matches
Namespaces | Functions
Generator.hpp File Reference
#include "Type.hpp"
#include "Device.hpp"
#include "cytnx_error.hpp"
#include "Tensor.hpp"
#include <vector>
#include <initializer_list>
Include dependency graph for Generator.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  cytnx
 

Functions

Tensor cytnx::zeros (const cytnx_uint64 &Nelem, const unsigned int &dtype=Type.Double, const int &device=Device.cpu)
 create an rank-1 Tensor with all the elements are initialized with zero.
 
Tensor cytnx::zeros (const std::vector< cytnx_uint64 > &Nelem, const unsigned int &dtype=Type.Double, const int &device=Device.cpu)
 create an Tensor with all the elements are initialized with zero.
 
Tensor cytnx::identity (const cytnx_uint64 &Dim, const unsigned int &dtype=Type.Double, const int &device=Device.cpu)
 create an square rank-2 Tensor with all diagonal to be one.
 
Tensor cytnx::eye (const cytnx_uint64 &Dim, const unsigned int &dtype=Type.Double, const int &device=Device.cpu)
 create a square rank-2 Tensor with all diagonal to be one.
 
Tensor cytnx::ones (const cytnx_uint64 &Nelem, const unsigned int &dtype=Type.Double, const int &device=Device.cpu)
 create an rank-1 Tensor with all the elements are initialized with one.
 
Tensor cytnx::ones (const std::vector< cytnx_uint64 > &Nelem, const unsigned int &dtype=Type.Double, const int &device=Device.cpu)
 create an Tensor with all the elements are initialized with one.
 
Tensor cytnx::arange (const cytnx_int64 &Nelem)
 create an rank-1 Tensor with incremental unsigned integer elements start with [0,Nelem)
 
Tensor cytnx::arange (const cytnx_double &start, const cytnx_double &end, const cytnx_double &step=1, const unsigned int &dtype=Type.Double, const int &device=Device.cpu)
 create an rank-1 Tensor with elements defined in range [start,end) with assigned step-size
 
Tensor cytnx::linspace (const cytnx_double &start, const cytnx_double &end, const cytnx_uint64 &Nelem, const bool &endpoint=true, const unsigned int &dtype=Type.Double, const int &device=Device.cpu)