1#ifndef CYTNX_GENERATOR_H_
2#define CYTNX_GENERATOR_H_
9#include <initializer_list>
29 const int &device =
Device.cpu);
42 Tensor zeros(
const std::vector<cytnx_uint64> &Nelem,
const unsigned int &dtype =
Type.Double,
43 const int &device =
Device.cpu);
59 const int &device =
Device.cpu);
76 Tensor eye(
const cytnx_uint64 &Dim,
const unsigned int &dtype =
Type.Double,
77 const int &device =
Device.cpu);
92 Tensor ones(
const cytnx_uint64 &Nelem,
const unsigned int &dtype =
Type.Double,
93 const int &device =
Device.cpu);
106 Tensor ones(
const std::vector<cytnx_uint64> &Nelem,
const unsigned int &dtype =
Type.Double,
107 const int &device =
Device.cpu);
134 Tensor arange(
const cytnx_double &start,
const cytnx_double &end,
const cytnx_double &step = 1,
135 const unsigned int &dtype =
Type.Double,
const int &device =
Device.cpu);
138 Tensor linspace(
const cytnx_double &start,
const cytnx_double &end,
const cytnx_uint64 &Nelem,
139 const bool &endpoint =
true,
const unsigned int &dtype =
Type.Double,
140 const int &device =
Device.cpu);
constexpr Type_class Type
data type
Definition Type.hpp:426
an tensor (multi-dimensional array)
Definition Tensor.hpp:41
Definition Accessor.hpp:12
Device_class Device
data on which devices.
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.
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 a square rank-2 Tensor with all diagonal to be one.