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 a rank-1 Tensor with all elements initialized to zero.
 
Tensor cytnx::zeros (const std::vector< cytnx_uint64 > &Nelem, const unsigned int &dtype=Type.Double, const int &device=Device.cpu)
 Create a Tensor with all elements initialized to zero.
 
Tensor cytnx::identity (const cytnx_uint64 &Dim, const unsigned int &dtype=Type.Double, const int &device=Device.cpu)
 Create a square rank-2 Tensor with the diagonal initialized to one and all other elements set to zero.
 
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 the diagonal initialized to one and all other elements set to zero.
 
Tensor cytnx::ones (const cytnx_uint64 &Nelem, const unsigned int &dtype=Type.Double, const int &device=Device.cpu)
 Create a rank-1 Tensor with all elements initialized to one.
 
Tensor cytnx::ones (const std::vector< cytnx_uint64 > &Nelem, const unsigned int &dtype=Type.Double, const int &device=Device.cpu)
 Create a Tensor with all elements initialized to one.
 
Tensor cytnx::arange (const cytnx_int64 &Nelem)
 Create a rank-1 Tensor with incremental unsigned integer elements in the range [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 a rank-1 Tensor with incremental elements in the range [start,end) with given step-size step between elements.
 
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)