1#ifndef CYTNX_GENERATOR_H_
2#define CYTNX_GENERATOR_H_
9#include <initializer_list>
28 Tensor zeros(
const std::vector<cytnx_uint64> &shape,
unsigned int dtype =
Type.Double,
30 Tensor zeros(std::initializer_list<cytnx_uint64> shape,
unsigned int dtype =
Type.Double,
80 Tensor ones(
const std::vector<cytnx_uint64> &shape,
unsigned int dtype =
Type.Double,
82 Tensor ones(std::initializer_list<cytnx_uint64> shape,
unsigned int dtype =
Type.Double,
108 Tensor arange(cytnx_double start, cytnx_double end, cytnx_double step = 1,
109 unsigned int dtype =
Type.Double,
int device =
Device.cpu);
112 Tensor linspace(cytnx_double start, cytnx_double end, cytnx_uint64 Nelem,
bool endpoint =
true,
113 unsigned int dtype =
Type.Double,
int device =
Device.cpu);
constexpr Type_class Type
data type
Definition Type.hpp:555
an tensor (multi-dimensional array)
Definition Tensor.hpp:41
Definition Accessor.hpp:12
Device_class Device
data on which devices.
Tensor 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 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 linspace(cytnx_double start, cytnx_double end, cytnx_uint64 Nelem, bool endpoint=true, unsigned int dtype=Type.Double, int device=Device.cpu)
Tensor 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 arange(cytnx_int64 Nelem)
Create a rank-1 Tensor with incremental unsigned integer elements in the range [0,...
Tensor 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...