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);
60 const int &device =
Device.cpu);
78 Tensor eye(
const cytnx_uint64 &Dim,
const unsigned int &dtype =
Type.Double,
79 const int &device =
Device.cpu);
94 Tensor ones(
const cytnx_uint64 &Nelem,
const unsigned int &dtype =
Type.Double,
95 const int &device =
Device.cpu);
108 Tensor ones(
const std::vector<cytnx_uint64> &Nelem,
const unsigned int &dtype =
Type.Double,
109 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 a rank-1 Tensor with incremental unsigned integer elements in the range [0,...
Tensor 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 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 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 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...