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 std::vector< cytnx_uint64 > &shape, unsigned int dtype=Type.Double, int device=Device.cpu)
 Create a Tensor with all elements initialized to zero.
 
Tensor cytnx::zeros (std::initializer_list< cytnx_uint64 > shape, unsigned int dtype=Type.Double, int device=Device.cpu)
 
Tensor cytnx::identity (cytnx_uint64 Dim, unsigned int dtype=Type.Double, 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 (cytnx_uint64 Dim, unsigned int dtype=Type.Double, 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 std::vector< cytnx_uint64 > &shape, unsigned int dtype=Type.Double, int device=Device.cpu)
 Create a Tensor with all elements initialized to one.
 
Tensor cytnx::ones (std::initializer_list< cytnx_uint64 > shape, unsigned int dtype=Type.Double, int device=Device.cpu)
 
Tensor cytnx::arange (cytnx_int64 Nelem)
 Create a rank-1 Tensor with incremental unsigned integer elements in the range [0,Nelem).
 
Tensor cytnx::arange (cytnx_double start, cytnx_double end, cytnx_double step=1, unsigned int dtype=Type.Double, 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 (cytnx_double start, cytnx_double end, cytnx_uint64 Nelem, bool endpoint=true, unsigned int dtype=Type.Double, int device=Device.cpu)