8#include <initializer_list>
28 const int &device =
Device.cpu);
41 Tensor zeros(
const std::vector<cytnx_uint64> &Nelem,
const unsigned int &dtype =
Type.Double,
42 const int &device =
Device.cpu);
58 const int &device =
Device.cpu);
76 const int &device =
Device.cpu);
92 const int &device =
Device.cpu);
105 Tensor ones(
const std::vector<cytnx_uint64> &Nelem,
const unsigned int &dtype =
Type.Double,
106 const int &device =
Device.cpu);
134 const unsigned int &dtype =
Type.Double,
const int &device =
Device.cpu);
138 const bool &endpoint =
true,
const unsigned int &dtype =
Type.Double,
139 const int &device =
Device.cpu);
an tensor (multi-dimensional array)
Definition Tensor.hpp:41
Helper function to print vector with ODT:
Definition Accessor.hpp:12
Device_class Device
data on which devices.
double cytnx_double
Definition Type.hpp:53
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)
Tensor arange(const cytnx_int64 &Nelem)
create an rank-1 Tensor with incremental unsigned integer elements start with [0,Nelem)
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.
uint64_t cytnx_uint64
Definition Type.hpp:55
int64_t cytnx_int64
Definition Type.hpp:58
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.
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.
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.