8#include <initializer_list>
25 const int &device =
Device.cpu);
38 Tensor
zeros(
const std::vector<cytnx_uint64> &Nelem,
const unsigned int &dtype =
Type.Double,
39 const int &device =
Device.cpu);
55 const int &device =
Device.cpu);
73 const int &device =
Device.cpu);
89 const int &device =
Device.cpu);
102 Tensor
ones(
const std::vector<cytnx_uint64> &Nelem,
const unsigned int &dtype =
Type.Double,
103 const int &device =
Device.cpu);
131 const unsigned int &dtype =
Type.Double,
const int &device =
Device.cpu);
135 const bool &endpoint =
true,
const unsigned int &dtype =
Type.Double,
136 const int &device =
Device.cpu);
Definition Accessor.hpp:12
Device_class Device
data on which devices.
Definition Device.cpp:140
double cytnx_double
Definition Type.hpp:43
Tensor 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)
Definition Generator.cpp:80
Tensor arange(const cytnx_int64 &Nelem)
create an rank-1 Tensor with incremental unsigned integer elements start with [0,Nelem)
Definition Generator.cpp:75
Tensor 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.
Definition Generator.cpp:25
uint64_t cytnx_uint64
Definition Type.hpp:45
int64_t cytnx_int64
Definition Type.hpp:48
Tensor 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.
Definition Generator.cpp:10
Type_class Type
data type
Definition Type.cpp:23
Tensor 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.
Definition Generator.cpp:37
Tensor eye(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.
Definition Generator.cpp:41