|
Cytnx v0.7.6
|
an tensor (multi-dimensional array) More...
#include <Tensor.hpp>
Public Member Functions | |
| void | Save (const std::string &fname) const |
| Save current Tensor to file. | |
| void | Save (const char *fname) const |
| void | Tofile (const std::string &fname) const |
| void | Tofile (const char *fname) const |
| void | Tofile (std::fstream &f) const |
| void | Init (const std::vector< cytnx_uint64 > &shape, const unsigned int &dtype=Type.Double, const int &device=-1) |
| initialize a Tensor | |
| Tensor (const std::vector< cytnx_uint64 > &shape, const unsigned int &dtype=Type.Double, const int &device=-1) | |
| unsigned int | dtype () const |
| the dtype-id of the Tensor | |
| int | device () const |
| the device-id of the Tensor | |
| std::string | dtype_str () const |
| the dtype (in string) of the Tensor | |
| std::string | device_str () const |
| the device (in string) of the Tensor | |
| const std::vector< cytnx_uint64 > & | shape () const |
| the shape of the Tensor | |
| cytnx_uint64 | rank () const |
| the rank of the Tensor | |
| Tensor | clone () const |
| return a clone of the current Tensor. | |
| Tensor | to (const int &device) const |
| copy a tensor to new device | |
| void | to_ (const int &device) |
| move the current Tensor to the device. | |
| const bool & | is_contiguous () const |
| Tensor | permute_ (const std::vector< cytnx_uint64 > &rnks) |
| Tensor | permute (const std::vector< cytnx_uint64 > &rnks) const |
| perform tensor permute on the cytnx::Tensor and return a new instance. | |
| Tensor | contiguous () const |
| Make the Tensor contiguous by coalescing the memory (storage). | |
| Tensor | contiguous_ () |
| Make the Tensor contiguous by coalescing the memory (storage), inplacely. | |
| void | reshape_ (const std::vector< cytnx_int64 > &new_shape) |
| reshape the Tensor, inplacely | |
| Tensor | reshape (const std::vector< cytnx_int64 > &new_shape) const |
| return a new Tensor that is reshaped. | |
| Tensor | reshape (const std::vector< cytnx_uint64 > &new_shape) const |
| Tensor | reshape (const std::initializer_list< cytnx_int64 > &new_shape) const |
| Tensor | astype (const int &new_type) const |
| return a new Tensor that cast to different dtype. | |
| template<class T > | |
| T & | at (const std::vector< cytnx_uint64 > &locator) |
| [C++ only] get an element at specific location. | |
| template<class T > | |
| const T & | at (const std::vector< cytnx_uint64 > &locator) const |
| template<class T > | |
| T & | item () |
| get an from a rank-0 Tensor | |
| Tensor | get (const std::vector< cytnx::Accessor > &accessors) const |
| get elements using Accessor (C++ API) / slices (python API) | |
| void | set (const std::vector< cytnx::Accessor > &accessors, const Tensor &rhs) |
| set elements with the input Tensor using Accessor (C++ API) / slices (python API) | |
| template<class T > | |
| void | set (const std::vector< cytnx::Accessor > &accessors, const T &rc) |
| set elements with the input constant using Accessor (C++ API) / slices (python API) | |
| Storage & | storage () const |
| return the storage of current Tensor. | |
| template<class T > | |
| void | fill (const T &val) |
| fill all the element of current Tensor with the value. | |
| bool | equiv (const Tensor &rhs) |
| Tensor | real () |
| Tensor | imag () |
| template<class T > | |
| Tensor & | operator+= (const T &rc) |
| template<class T > | |
| Tensor & | operator-= (const T &rc) |
| template<class T > | |
| Tensor & | operator*= (const T &rc) |
| template<class T > | |
| Tensor & | operator/= (const T &rc) |
| template<class T > | |
| Tensor | Add (const T &rhs) |
| template<class T > | |
| Tensor & | Add_ (const T &rhs) |
| template<class T > | |
| Tensor | Sub (const T &rhs) |
| template<class T > | |
| Tensor & | Sub_ (const T &rhs) |
| template<class T > | |
| Tensor | Mul (const T &rhs) |
| template<class T > | |
| Tensor & | Mul_ (const T &rhs) |
| template<class T > | |
| Tensor | Div (const T &rhs) |
| template<class T > | |
| Tensor & | Div_ (const T &rhs) |
| template<class T > | |
| Tensor | Cpr (const T &rhs) |
| template<class T > | |
| Tensor | Mod (const T &rhs) |
| Tensor | operator- () |
| Tensor | flatten () const |
| void | flatten_ () |
| void | append (const Tensor &rhs) |
| void | append (const Storage &srhs) |
| template<class T > | |
| void | append (const T &rhs) |
| bool | same_data (const Tensor &rhs) const |
| std::vector< Tensor > | Svd (const bool &is_U=true, const bool &is_vT=true) const |
| std::vector< Tensor > | Eigh (const bool &is_V=true, const bool &row_v=false) const |
| Tensor & | InvM_ () |
| Tensor | InvM () const |
| Tensor & | Inv_ (const double &clip) |
| Tensor | Inv (const double &clip) const |
| Tensor & | Conj_ () |
| Tensor | Conj () const |
| Tensor & | Exp_ () |
| Tensor | Exp () const |
| Tensor | Norm () const |
| Tensor | Pow (const cytnx_double &p) const |
| Tensor & | Pow_ (const cytnx_double &p) |
| Tensor | Trace (const cytnx_uint64 &a=0, const cytnx_uint64 &b=1) const |
| Tensor | Abs () const |
| Tensor & | Abs_ () |
| Tensor | Max () const |
| Tensor | Min () const |
| template<> | |
| Tensor & | operator+= (const Tensor &rc) |
| template<> | |
| Tensor & | operator+= (const cytnx_complex128 &rc) |
| template<> | |
| Tensor & | operator+= (const cytnx_complex64 &rc) |
| template<> | |
| Tensor & | operator+= (const cytnx_double &rc) |
| template<> | |
| Tensor & | operator+= (const cytnx_float &rc) |
| template<> | |
| Tensor & | operator+= (const cytnx_int64 &rc) |
| template<> | |
| Tensor & | operator+= (const cytnx_uint64 &rc) |
| template<> | |
| Tensor & | operator+= (const cytnx_int32 &rc) |
| template<> | |
| Tensor & | operator+= (const cytnx_uint32 &rc) |
| template<> | |
| Tensor & | operator+= (const cytnx_int16 &rc) |
| template<> | |
| Tensor & | operator+= (const cytnx_uint16 &rc) |
| template<> | |
| Tensor & | operator+= (const cytnx_bool &rc) |
| template<> | |
| Tensor & | operator+= (const Scalar &rc) |
| template<> | |
| Tensor & | operator-= (const Tensor &rc) |
| template<> | |
| Tensor & | operator-= (const cytnx_complex128 &rc) |
| template<> | |
| Tensor & | operator-= (const cytnx_complex64 &rc) |
| template<> | |
| Tensor & | operator-= (const cytnx_double &rc) |
| template<> | |
| Tensor & | operator-= (const cytnx_float &rc) |
| template<> | |
| Tensor & | operator-= (const cytnx_int64 &rc) |
| template<> | |
| Tensor & | operator-= (const cytnx_uint64 &rc) |
| template<> | |
| Tensor & | operator-= (const cytnx_int32 &rc) |
| template<> | |
| Tensor & | operator-= (const cytnx_uint32 &rc) |
| template<> | |
| Tensor & | operator-= (const cytnx_int16 &rc) |
| template<> | |
| Tensor & | operator-= (const cytnx_uint16 &rc) |
| template<> | |
| Tensor & | operator-= (const cytnx_bool &rc) |
| template<> | |
| Tensor & | operator-= (const Scalar &rc) |
| template<> | |
| Tensor & | operator*= (const Tensor &rc) |
| template<> | |
| Tensor & | operator*= (const cytnx_complex128 &rc) |
| template<> | |
| Tensor & | operator*= (const cytnx_complex64 &rc) |
| template<> | |
| Tensor & | operator*= (const cytnx_double &rc) |
| template<> | |
| Tensor & | operator*= (const cytnx_float &rc) |
| template<> | |
| Tensor & | operator*= (const cytnx_int64 &rc) |
| template<> | |
| Tensor & | operator*= (const cytnx_uint64 &rc) |
| template<> | |
| Tensor & | operator*= (const cytnx_int32 &rc) |
| template<> | |
| Tensor & | operator*= (const cytnx_uint32 &rc) |
| template<> | |
| Tensor & | operator*= (const cytnx_int16 &rc) |
| template<> | |
| Tensor & | operator*= (const cytnx_uint16 &rc) |
| template<> | |
| Tensor & | operator*= (const cytnx_bool &rc) |
| template<> | |
| Tensor & | operator*= (const Scalar &rc) |
| template<> | |
| Tensor & | operator/= (const Tensor &rc) |
| template<> | |
| Tensor & | operator/= (const cytnx_complex128 &rc) |
| template<> | |
| Tensor & | operator/= (const cytnx_complex64 &rc) |
| template<> | |
| Tensor & | operator/= (const cytnx_double &rc) |
| template<> | |
| Tensor & | operator/= (const cytnx_float &rc) |
| template<> | |
| Tensor & | operator/= (const cytnx_int64 &rc) |
| template<> | |
| Tensor & | operator/= (const cytnx_uint64 &rc) |
| template<> | |
| Tensor & | operator/= (const cytnx_int32 &rc) |
| template<> | |
| Tensor & | operator/= (const cytnx_uint32 &rc) |
| template<> | |
| Tensor & | operator/= (const cytnx_int16 &rc) |
| template<> | |
| Tensor & | operator/= (const cytnx_uint16 &rc) |
| template<> | |
| Tensor & | operator/= (const cytnx_bool &rc) |
| template<> | |
| Tensor & | operator/= (const Scalar &rc) |
Static Public Member Functions | |
| static Tensor | Load (const std::string &fname) |
| Load current Tensor to file. | |
| static Tensor | Load (const char *fname) |
| static Tensor | Fromfile (const std::string &fname, const unsigned int &dtype, const cytnx_int64 &count=-1) |
| static Tensor | Fromfile (const char *fname, const unsigned int &dtype, const cytnx_int64 &count=-1) |
| static Tensor | from_storage (const Storage &in) |
an tensor (multi-dimensional array)
|
inline |
| Tensor cytnx::Tensor::Abs | ( | ) | const |
| Tensor & cytnx::Tensor::Abs_ | ( | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
return a new Tensor that cast to different dtype.
| new_type | the new dtype. It can be any type defined in cytnx::Type |
If the new_type is the same as dtype of the current Tensor, return self.
Total elem: 60 type : Double (Float64) cytnx device: CPU Shape : (3,4,5) [[[0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ]] [[0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ]] [[0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ]]] Total elem: 60 type : Uint64 cytnx device: CPU Shape : (3,4,5) [[[ 0 0 0 0 0 ] [ 0 0 0 0 0 ] [ 0 0 0 0 0 ] [ 0 0 0 0 0 ]] [[ 0 0 0 0 0 ] [ 0 0 0 0 0 ] [ 0 0 0 0 0 ] [ 0 0 0 0 0 ]] [[ 0 0 0 0 0 ] [ 0 0 0 0 0 ] [ 0 0 0 0 0 ] [ 0 0 0 0 0 ]]] 1
Total elem: 60 type : Double (Float64) cytnx device: CPU Shape : (3,4,5) [[[0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ]] [[0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ]] [[0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ]]] Total elem: 60 type : Uint64 cytnx device: CPU Shape : (3,4,5) [[[ 0 0 0 0 0 ] [ 0 0 0 0 0 ] [ 0 0 0 0 0 ] [ 0 0 0 0 0 ]] [[ 0 0 0 0 0 ] [ 0 0 0 0 0 ] [ 0 0 0 0 0 ] [ 0 0 0 0 0 ]] [[ 0 0 0 0 0 ] [ 0 0 0 0 0 ] [ 0 0 0 0 0 ] [ 0 0 0 0 0 ]]] True
|
inline |
[C++ only] get an element at specific location.
| locator | the location of the element |
|
inline |
|
inline |
return a clone of the current Tensor.
description:
In C++ API, the behavior of assignment operator is designed to have same behavior as python,
to have a copy of the current tensor, we call clone to return a copy.
1 0
True False
| Tensor cytnx::Tensor::Conj | ( | ) | const |
| Tensor & cytnx::Tensor::Conj_ | ( | ) |
|
inline |
Make the Tensor contiguous by coalescing the memory (storage).
See also Tensor::contiguous_()
Vector Print: Total Elements:3 [3, 4, 5] Vector Print: Total Elements:3 [3, 5, 4] 0 1 Vector Print: Total Elements:3 [3, 5, 4] 0 1
[3, 4, 5] [3, 5, 4] False True [3, 5, 4]
|
inline |
Make the Tensor contiguous by coalescing the memory (storage), inplacely.
See also Tensor::contiguous()
Vector Print: Total Elements:3 [3, 4, 5] Vector Print: Total Elements:3 [3, 5, 4] 0 1
[3, 4, 5] [3, 5, 4] False True
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| std::vector< Tensor > cytnx::Tensor::Eigh | ( | const bool & | is_V = true, |
| const bool & | row_v = false |
||
| ) | const |
|
inline |
| Tensor cytnx::Tensor::Exp | ( | ) | const |
| Tensor & cytnx::Tensor::Exp_ | ( | ) |
|
inline |
fill all the element of current Tensor with the value.
| val | the assigned value |
Total elem: 60 type : Double (Float64) cytnx device: CPU Shape : (3,4,5) [[[0.00000e+00 1.00000e+00 2.00000e+00 3.00000e+00 4.00000e+00 ] [5.00000e+00 6.00000e+00 7.00000e+00 8.00000e+00 9.00000e+00 ] [1.00000e+01 1.10000e+01 1.20000e+01 1.30000e+01 1.40000e+01 ] [1.50000e+01 1.60000e+01 1.70000e+01 1.80000e+01 1.90000e+01 ]] [[2.00000e+01 2.10000e+01 2.20000e+01 2.30000e+01 2.40000e+01 ] [2.50000e+01 2.60000e+01 2.70000e+01 2.80000e+01 2.90000e+01 ] [3.00000e+01 3.10000e+01 3.20000e+01 3.30000e+01 3.40000e+01 ] [3.50000e+01 3.60000e+01 3.70000e+01 3.80000e+01 3.90000e+01 ]] [[4.00000e+01 4.10000e+01 4.20000e+01 4.30000e+01 4.40000e+01 ] [4.50000e+01 4.60000e+01 4.70000e+01 4.80000e+01 4.90000e+01 ] [5.00000e+01 5.10000e+01 5.20000e+01 5.30000e+01 5.40000e+01 ] [5.50000e+01 5.60000e+01 5.70000e+01 5.80000e+01 5.90000e+01 ]]] Total elem: 60 type : Double (Float64) cytnx device: CPU Shape : (3,4,5) [[[9.99000e+02 9.99000e+02 9.99000e+02 9.99000e+02 9.99000e+02 ] [9.99000e+02 9.99000e+02 9.99000e+02 9.99000e+02 9.99000e+02 ] [9.99000e+02 9.99000e+02 9.99000e+02 9.99000e+02 9.99000e+02 ] [9.99000e+02 9.99000e+02 9.99000e+02 9.99000e+02 9.99000e+02 ]] [[9.99000e+02 9.99000e+02 9.99000e+02 9.99000e+02 9.99000e+02 ] [9.99000e+02 9.99000e+02 9.99000e+02 9.99000e+02 9.99000e+02 ] [9.99000e+02 9.99000e+02 9.99000e+02 9.99000e+02 9.99000e+02 ] [9.99000e+02 9.99000e+02 9.99000e+02 9.99000e+02 9.99000e+02 ]] [[9.99000e+02 9.99000e+02 9.99000e+02 9.99000e+02 9.99000e+02 ] [9.99000e+02 9.99000e+02 9.99000e+02 9.99000e+02 9.99000e+02 ] [9.99000e+02 9.99000e+02 9.99000e+02 9.99000e+02 9.99000e+02 ] [9.99000e+02 9.99000e+02 9.99000e+02 9.99000e+02 9.99000e+02 ]]]
Total elem: 60 type : Double (Float64) cytnx device: CPU Shape : (3,4,5) [[[0.00000e+00 1.00000e+00 2.00000e+00 3.00000e+00 4.00000e+00 ] [5.00000e+00 6.00000e+00 7.00000e+00 8.00000e+00 9.00000e+00 ] [1.00000e+01 1.10000e+01 1.20000e+01 1.30000e+01 1.40000e+01 ] [1.50000e+01 1.60000e+01 1.70000e+01 1.80000e+01 1.90000e+01 ]] [[2.00000e+01 2.10000e+01 2.20000e+01 2.30000e+01 2.40000e+01 ] [2.50000e+01 2.60000e+01 2.70000e+01 2.80000e+01 2.90000e+01 ] [3.00000e+01 3.10000e+01 3.20000e+01 3.30000e+01 3.40000e+01 ] [3.50000e+01 3.60000e+01 3.70000e+01 3.80000e+01 3.90000e+01 ]] [[4.00000e+01 4.10000e+01 4.20000e+01 4.30000e+01 4.40000e+01 ] [4.50000e+01 4.60000e+01 4.70000e+01 4.80000e+01 4.90000e+01 ] [5.00000e+01 5.10000e+01 5.20000e+01 5.30000e+01 5.40000e+01 ] [5.50000e+01 5.60000e+01 5.70000e+01 5.80000e+01 5.90000e+01 ]]] Total elem: 60 type : Double (Float64) cytnx device: CPU Shape : (3,4,5) [[[9.99000e+02 9.99000e+02 9.99000e+02 9.99000e+02 9.99000e+02 ] [9.99000e+02 9.99000e+02 9.99000e+02 9.99000e+02 9.99000e+02 ] [9.99000e+02 9.99000e+02 9.99000e+02 9.99000e+02 9.99000e+02 ] [9.99000e+02 9.99000e+02 9.99000e+02 9.99000e+02 9.99000e+02 ]] [[9.99000e+02 9.99000e+02 9.99000e+02 9.99000e+02 9.99000e+02 ] [9.99000e+02 9.99000e+02 9.99000e+02 9.99000e+02 9.99000e+02 ] [9.99000e+02 9.99000e+02 9.99000e+02 9.99000e+02 9.99000e+02 ] [9.99000e+02 9.99000e+02 9.99000e+02 9.99000e+02 9.99000e+02 ]] [[9.99000e+02 9.99000e+02 9.99000e+02 9.99000e+02 9.99000e+02 ] [9.99000e+02 9.99000e+02 9.99000e+02 9.99000e+02 9.99000e+02 ] [9.99000e+02 9.99000e+02 9.99000e+02 9.99000e+02 9.99000e+02 ] [9.99000e+02 9.99000e+02 9.99000e+02 9.99000e+02 9.99000e+02 ]]]
|
inline |
|
inline |
|
static |
|
static |
|
inline |
get elements using Accessor (C++ API) / slices (python API)
See also Accessor for cordinate with Accessor in C++ API.
One can also using more intruisive way to get the slice using [] operator.
Total elem: 60 type : Double (Float64) cytnx device: CPU Shape : (3,4,5) [[[0.00000e+00 1.00000e+00 2.00000e+00 3.00000e+00 4.00000e+00 ] [5.00000e+00 6.00000e+00 7.00000e+00 8.00000e+00 9.00000e+00 ] [1.00000e+01 1.10000e+01 1.20000e+01 1.30000e+01 1.40000e+01 ] [1.50000e+01 1.60000e+01 1.70000e+01 1.80000e+01 1.90000e+01 ]] [[2.00000e+01 2.10000e+01 2.20000e+01 2.30000e+01 2.40000e+01 ] [2.50000e+01 2.60000e+01 2.70000e+01 2.80000e+01 2.90000e+01 ] [3.00000e+01 3.10000e+01 3.20000e+01 3.30000e+01 3.40000e+01 ] [3.50000e+01 3.60000e+01 3.70000e+01 3.80000e+01 3.90000e+01 ]] [[4.00000e+01 4.10000e+01 4.20000e+01 4.30000e+01 4.40000e+01 ] [4.50000e+01 4.60000e+01 4.70000e+01 4.80000e+01 4.90000e+01 ] [5.00000e+01 5.10000e+01 5.20000e+01 5.30000e+01 5.40000e+01 ] [5.50000e+01 5.60000e+01 5.70000e+01 5.80000e+01 5.90000e+01 ]]] Total elem: 12 type : Double (Float64) cytnx device: CPU Shape : (4,3) [[4.20000e+01 4.30000e+01 4.40000e+01 ] [4.70000e+01 4.80000e+01 4.90000e+01 ] [5.20000e+01 5.30000e+01 5.40000e+01 ] [5.70000e+01 5.80000e+01 5.90000e+01 ]] Total elem: 12 type : Double (Float64) cytnx device: CPU Shape : (4,3) [[4.20000e+01 4.30000e+01 4.40000e+01 ] [4.70000e+01 4.80000e+01 4.90000e+01 ] [5.20000e+01 5.30000e+01 5.40000e+01 ] [5.70000e+01 5.80000e+01 5.90000e+01 ]]
Total elem: 60 type : Double (Float64) cytnx device: CPU Shape : (3,4,5) [[[0.00000e+00 1.00000e+00 2.00000e+00 3.00000e+00 4.00000e+00 ] [5.00000e+00 6.00000e+00 7.00000e+00 8.00000e+00 9.00000e+00 ] [1.00000e+01 1.10000e+01 1.20000e+01 1.30000e+01 1.40000e+01 ] [1.50000e+01 1.60000e+01 1.70000e+01 1.80000e+01 1.90000e+01 ]] [[2.00000e+01 2.10000e+01 2.20000e+01 2.30000e+01 2.40000e+01 ] [2.50000e+01 2.60000e+01 2.70000e+01 2.80000e+01 2.90000e+01 ] [3.00000e+01 3.10000e+01 3.20000e+01 3.30000e+01 3.40000e+01 ] [3.50000e+01 3.60000e+01 3.70000e+01 3.80000e+01 3.90000e+01 ]] [[4.00000e+01 4.10000e+01 4.20000e+01 4.30000e+01 4.40000e+01 ] [4.50000e+01 4.60000e+01 4.70000e+01 4.80000e+01 4.90000e+01 ] [5.00000e+01 5.10000e+01 5.20000e+01 5.30000e+01 5.40000e+01 ] [5.50000e+01 5.60000e+01 5.70000e+01 5.80000e+01 5.90000e+01 ]]] Total elem: 12 type : Double (Float64) cytnx device: CPU Shape : (4,3) [[4.20000e+01 4.30000e+01 4.40000e+01 ] [4.70000e+01 4.80000e+01 4.90000e+01 ] [5.20000e+01 5.30000e+01 5.40000e+01 ] [5.70000e+01 5.80000e+01 5.90000e+01 ]]
| Tensor cytnx::Tensor::imag | ( | ) |
|
inline |
initialize a Tensor
| shape | the shape of tensor. |
| dtype | the dtype of tensor. This can be any of type defined in cytnx::Type |
| device | the device that tensor to be created. This can be cytnx::Device.cpu or cytnx::Device.cuda+<gpuid> |
[Note]
Total elem: 60 type : Double (Float64) cytnx device: CPU Shape : (3,4,5) [[[0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ]] [[0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ]] [[0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ]]] Total elem: 60 type : Uint64 cytnx device: CPU Shape : (3,4,5) [[[ 0 0 0 0 0 ] [ 0 0 0 0 0 ] [ 0 0 0 0 0 ] [ 0 0 0 0 0 ]] [[ 0 0 0 0 0 ] [ 0 0 0 0 0 ] [ 0 0 0 0 0 ] [ 0 0 0 0 0 ]] [[ 0 0 0 0 0 ] [ 0 0 0 0 0 ] [ 0 0 0 0 0 ] [ 0 0 0 0 0 ]]] Total elem: 60 type : Double (Float64) cytnx device: CUDA/GPU-id:0 Shape : (3,4,5) [[[0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ]] [[0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ]] [[0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ]]]
Total elem: 60 type : Double (Float64) cytnx device: CPU Shape : (3,4,5) [[[0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ]] [[0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ]] [[0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ]]] Total elem: 60 type : Uint64 cytnx device: CPU Shape : (3,4,5) [[[ 0 0 0 0 0 ] [ 0 0 0 0 0 ] [ 0 0 0 0 0 ] [ 0 0 0 0 0 ]] [[ 0 0 0 0 0 ] [ 0 0 0 0 0 ] [ 0 0 0 0 0 ] [ 0 0 0 0 0 ]] [[ 0 0 0 0 0 ] [ 0 0 0 0 0 ] [ 0 0 0 0 0 ] [ 0 0 0 0 0 ]]] Total elem: 60 type : Double (Float64) cytnx device: CUDA/GPU-id:0 Shape : (3,4,5) [[[0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ]] [[0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ]] [[0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 ]]]
| Tensor cytnx::Tensor::Inv | ( | const double & | clip | ) | const |
| Tensor & cytnx::Tensor::Inv_ | ( | const double & | clip | ) |
| Tensor cytnx::Tensor::InvM | ( | ) | const |
| Tensor & cytnx::Tensor::InvM_ | ( | ) |
|
inline |
|
inline |
get an from a rank-0 Tensor
Total elem: 1 type : Uint64 cytnx device: CPU Shape : (1) [ 1 ] 1
Total elem: 1 type : Uint64 cytnx device: CPU Shape : (1) [ 1 ] 1
|
static |
|
static |
| Tensor cytnx::Tensor::Max | ( | ) | const |
| Tensor cytnx::Tensor::Min | ( | ) | const |
|
inline |
|
inline |
|
inline |
| Tensor cytnx::Tensor::Norm | ( | ) | const |
| Tensor & cytnx::Tensor::operator*= | ( | const cytnx_bool & | rc | ) |
| Tensor & cytnx::Tensor::operator*= | ( | const cytnx_complex128 & | rc | ) |
| Tensor & cytnx::Tensor::operator*= | ( | const cytnx_complex64 & | rc | ) |
| Tensor & cytnx::Tensor::operator*= | ( | const cytnx_double & | rc | ) |
| Tensor & cytnx::Tensor::operator*= | ( | const cytnx_float & | rc | ) |
| Tensor & cytnx::Tensor::operator*= | ( | const cytnx_int16 & | rc | ) |
| Tensor & cytnx::Tensor::operator*= | ( | const cytnx_int32 & | rc | ) |
| Tensor & cytnx::Tensor::operator*= | ( | const cytnx_int64 & | rc | ) |
| Tensor & cytnx::Tensor::operator*= | ( | const cytnx_uint16 & | rc | ) |
| Tensor & cytnx::Tensor::operator*= | ( | const cytnx_uint32 & | rc | ) |
| Tensor & cytnx::Tensor::operator*= | ( | const cytnx_uint64 & | rc | ) |
| Tensor & cytnx::Tensor::operator*= | ( | const T & | rc | ) |
| Tensor & cytnx::Tensor::operator+= | ( | const cytnx_bool & | rc | ) |
| Tensor & cytnx::Tensor::operator+= | ( | const cytnx_complex128 & | rc | ) |
| Tensor & cytnx::Tensor::operator+= | ( | const cytnx_complex64 & | rc | ) |
| Tensor & cytnx::Tensor::operator+= | ( | const cytnx_double & | rc | ) |
| Tensor & cytnx::Tensor::operator+= | ( | const cytnx_float & | rc | ) |
| Tensor & cytnx::Tensor::operator+= | ( | const cytnx_int16 & | rc | ) |
| Tensor & cytnx::Tensor::operator+= | ( | const cytnx_int32 & | rc | ) |
| Tensor & cytnx::Tensor::operator+= | ( | const cytnx_int64 & | rc | ) |
| Tensor & cytnx::Tensor::operator+= | ( | const cytnx_uint16 & | rc | ) |
| Tensor & cytnx::Tensor::operator+= | ( | const cytnx_uint32 & | rc | ) |
| Tensor & cytnx::Tensor::operator+= | ( | const cytnx_uint64 & | rc | ) |
| Tensor & cytnx::Tensor::operator+= | ( | const T & | rc | ) |
|
inline |
| Tensor & cytnx::Tensor::operator-= | ( | const cytnx_bool & | rc | ) |
| Tensor & cytnx::Tensor::operator-= | ( | const cytnx_complex128 & | rc | ) |
| Tensor & cytnx::Tensor::operator-= | ( | const cytnx_complex64 & | rc | ) |
| Tensor & cytnx::Tensor::operator-= | ( | const cytnx_double & | rc | ) |
| Tensor & cytnx::Tensor::operator-= | ( | const cytnx_float & | rc | ) |
| Tensor & cytnx::Tensor::operator-= | ( | const cytnx_int16 & | rc | ) |
| Tensor & cytnx::Tensor::operator-= | ( | const cytnx_int32 & | rc | ) |
| Tensor & cytnx::Tensor::operator-= | ( | const cytnx_int64 & | rc | ) |
| Tensor & cytnx::Tensor::operator-= | ( | const cytnx_uint16 & | rc | ) |
| Tensor & cytnx::Tensor::operator-= | ( | const cytnx_uint32 & | rc | ) |
| Tensor & cytnx::Tensor::operator-= | ( | const cytnx_uint64 & | rc | ) |
| Tensor & cytnx::Tensor::operator-= | ( | const T & | rc | ) |
| Tensor & cytnx::Tensor::operator/= | ( | const cytnx_bool & | rc | ) |
| Tensor & cytnx::Tensor::operator/= | ( | const cytnx_complex128 & | rc | ) |
| Tensor & cytnx::Tensor::operator/= | ( | const cytnx_complex64 & | rc | ) |
| Tensor & cytnx::Tensor::operator/= | ( | const cytnx_double & | rc | ) |
| Tensor & cytnx::Tensor::operator/= | ( | const cytnx_float & | rc | ) |
| Tensor & cytnx::Tensor::operator/= | ( | const cytnx_int16 & | rc | ) |
| Tensor & cytnx::Tensor::operator/= | ( | const cytnx_int32 & | rc | ) |
| Tensor & cytnx::Tensor::operator/= | ( | const cytnx_int64 & | rc | ) |
| Tensor & cytnx::Tensor::operator/= | ( | const cytnx_uint16 & | rc | ) |
| Tensor & cytnx::Tensor::operator/= | ( | const cytnx_uint32 & | rc | ) |
| Tensor & cytnx::Tensor::operator/= | ( | const cytnx_uint64 & | rc | ) |
| Tensor & cytnx::Tensor::operator/= | ( | const T & | rc | ) |
|
inline |
perform tensor permute on the cytnx::Tensor and return a new instance.
| rnks | the permute indices, should have No. of elements equal to the rank of tensor. |
Vector Print: Total Elements:3 [3, 4, 5] Vector Print: Total Elements:3 [3, 5, 4] 0 1
[3, 4, 5] [3, 5, 4] False True
|
inline |
| Tensor cytnx::Tensor::Pow | ( | const cytnx_double & | p | ) | const |
| Tensor & cytnx::Tensor::Pow_ | ( | const cytnx_double & | p | ) |
|
inline |
| Tensor cytnx::Tensor::real | ( | ) |
|
inline |
|
inline |
return a new Tensor that is reshaped.
| new_shape | the new shape of the Tensor. |
See also Tensor::reshape_()
Total elem: 60 type : Double (Float64) cytnx device: CPU Shape : (60) [0.00000e+00 1.00000e+00 2.00000e+00 3.00000e+00 4.00000e+00 5.00000e+00 6.00000e+00 7.00000e+00 8.00000e+00 9.00000e+00 1.00000e+01 1.10000e+01 1.20000e+01 1.30000e+01 1.40000e+01 1.50000e+01 1.60000e+01 1.70000e+01 1.80000e+01 1.90000e+01 2.00000e+01 2.10000e+01 2.20000e+01 2.30000e+01 2.40000e+01 2.50000e+01 2.60000e+01 2.70000e+01 2.80000e+01 2.90000e+01 3.00000e+01 3.10000e+01 3.20000e+01 3.30000e+01 3.40000e+01 3.50000e+01 3.60000e+01 3.70000e+01 3.80000e+01 3.90000e+01 4.00000e+01 4.10000e+01 4.20000e+01 4.30000e+01 4.40000e+01 4.50000e+01 4.60000e+01 4.70000e+01 4.80000e+01 4.90000e+01 5.00000e+01 5.10000e+01 5.20000e+01 5.30000e+01 5.40000e+01 5.50000e+01 5.60000e+01 5.70000e+01 5.80000e+01 5.90000e+01 ] Total elem: 60 type : Double (Float64) cytnx device: CPU Shape : (5,12) [[0.00000e+00 1.00000e+00 2.00000e+00 3.00000e+00 4.00000e+00 5.00000e+00 6.00000e+00 7.00000e+00 8.00000e+00 9.00000e+00 1.00000e+01 1.10000e+01 ] [1.20000e+01 1.30000e+01 1.40000e+01 1.50000e+01 1.60000e+01 1.70000e+01 1.80000e+01 1.90000e+01 2.00000e+01 2.10000e+01 2.20000e+01 2.30000e+01 ] [2.40000e+01 2.50000e+01 2.60000e+01 2.70000e+01 2.80000e+01 2.90000e+01 3.00000e+01 3.10000e+01 3.20000e+01 3.30000e+01 3.40000e+01 3.50000e+01 ] [3.60000e+01 3.70000e+01 3.80000e+01 3.90000e+01 4.00000e+01 4.10000e+01 4.20000e+01 4.30000e+01 4.40000e+01 4.50000e+01 4.60000e+01 4.70000e+01 ] [4.80000e+01 4.90000e+01 5.00000e+01 5.10000e+01 5.20000e+01 5.30000e+01 5.40000e+01 5.50000e+01 5.60000e+01 5.70000e+01 5.80000e+01 5.90000e+01 ]]
Total elem: 60 type : Double (Float64) cytnx device: CPU Shape : (60) [0.00000e+00 1.00000e+00 2.00000e+00 3.00000e+00 4.00000e+00 5.00000e+00 6.00000e+00 7.00000e+00 8.00000e+00 9.00000e+00 1.00000e+01 1.10000e+01 1.20000e+01 1.30000e+01 1.40000e+01 1.50000e+01 1.60000e+01 1.70000e+01 1.80000e+01 1.90000e+01 2.00000e+01 2.10000e+01 2.20000e+01 2.30000e+01 2.40000e+01 2.50000e+01 2.60000e+01 2.70000e+01 2.80000e+01 2.90000e+01 3.00000e+01 3.10000e+01 3.20000e+01 3.30000e+01 3.40000e+01 3.50000e+01 3.60000e+01 3.70000e+01 3.80000e+01 3.90000e+01 4.00000e+01 4.10000e+01 4.20000e+01 4.30000e+01 4.40000e+01 4.50000e+01 4.60000e+01 4.70000e+01 4.80000e+01 4.90000e+01 5.00000e+01 5.10000e+01 5.20000e+01 5.30000e+01 5.40000e+01 5.50000e+01 5.60000e+01 5.70000e+01 5.80000e+01 5.90000e+01 ] Total elem: 60 type : Double (Float64) cytnx device: CPU Shape : (5,12) [[0.00000e+00 1.00000e+00 2.00000e+00 3.00000e+00 4.00000e+00 5.00000e+00 6.00000e+00 7.00000e+00 8.00000e+00 9.00000e+00 1.00000e+01 1.10000e+01 ] [1.20000e+01 1.30000e+01 1.40000e+01 1.50000e+01 1.60000e+01 1.70000e+01 1.80000e+01 1.90000e+01 2.00000e+01 2.10000e+01 2.20000e+01 2.30000e+01 ] [2.40000e+01 2.50000e+01 2.60000e+01 2.70000e+01 2.80000e+01 2.90000e+01 3.00000e+01 3.10000e+01 3.20000e+01 3.30000e+01 3.40000e+01 3.50000e+01 ] [3.60000e+01 3.70000e+01 3.80000e+01 3.90000e+01 4.00000e+01 4.10000e+01 4.20000e+01 4.30000e+01 4.40000e+01 4.50000e+01 4.60000e+01 4.70000e+01 ] [4.80000e+01 4.90000e+01 5.00000e+01 5.10000e+01 5.20000e+01 5.30000e+01 5.40000e+01 5.50000e+01 5.60000e+01 5.70000e+01 5.80000e+01 5.90000e+01 ]]
|
inline |
|
inline |
reshape the Tensor, inplacely
| new_shape | the new shape of the Tensor. |
See also Tensor::reshape()
Total elem: 60 type : Double (Float64) cytnx device: CPU Shape : (60) [0.00000e+00 1.00000e+00 2.00000e+00 3.00000e+00 4.00000e+00 5.00000e+00 6.00000e+00 7.00000e+00 8.00000e+00 9.00000e+00 1.00000e+01 1.10000e+01 1.20000e+01 1.30000e+01 1.40000e+01 1.50000e+01 1.60000e+01 1.70000e+01 1.80000e+01 1.90000e+01 2.00000e+01 2.10000e+01 2.20000e+01 2.30000e+01 2.40000e+01 2.50000e+01 2.60000e+01 2.70000e+01 2.80000e+01 2.90000e+01 3.00000e+01 3.10000e+01 3.20000e+01 3.30000e+01 3.40000e+01 3.50000e+01 3.60000e+01 3.70000e+01 3.80000e+01 3.90000e+01 4.00000e+01 4.10000e+01 4.20000e+01 4.30000e+01 4.40000e+01 4.50000e+01 4.60000e+01 4.70000e+01 4.80000e+01 4.90000e+01 5.00000e+01 5.10000e+01 5.20000e+01 5.30000e+01 5.40000e+01 5.50000e+01 5.60000e+01 5.70000e+01 5.80000e+01 5.90000e+01 ] Total elem: 60 type : Double (Float64) cytnx device: CPU Shape : (5,12) [[0.00000e+00 1.00000e+00 2.00000e+00 3.00000e+00 4.00000e+00 5.00000e+00 6.00000e+00 7.00000e+00 8.00000e+00 9.00000e+00 1.00000e+01 1.10000e+01 ] [1.20000e+01 1.30000e+01 1.40000e+01 1.50000e+01 1.60000e+01 1.70000e+01 1.80000e+01 1.90000e+01 2.00000e+01 2.10000e+01 2.20000e+01 2.30000e+01 ] [2.40000e+01 2.50000e+01 2.60000e+01 2.70000e+01 2.80000e+01 2.90000e+01 3.00000e+01 3.10000e+01 3.20000e+01 3.30000e+01 3.40000e+01 3.50000e+01 ] [3.60000e+01 3.70000e+01 3.80000e+01 3.90000e+01 4.00000e+01 4.10000e+01 4.20000e+01 4.30000e+01 4.40000e+01 4.50000e+01 4.60000e+01 4.70000e+01 ] [4.80000e+01 4.90000e+01 5.00000e+01 5.10000e+01 5.20000e+01 5.30000e+01 5.40000e+01 5.50000e+01 5.60000e+01 5.70000e+01 5.80000e+01 5.90000e+01 ]] Total elem: 60 type : Double (Float64) cytnx device: CPU Shape : (5,4,3) [[[0.00000e+00 1.00000e+00 2.00000e+00 ] [3.00000e+00 4.00000e+00 5.00000e+00 ] [6.00000e+00 7.00000e+00 8.00000e+00 ] [9.00000e+00 1.00000e+01 1.10000e+01 ]] [[1.20000e+01 1.30000e+01 1.40000e+01 ] [1.50000e+01 1.60000e+01 1.70000e+01 ] [1.80000e+01 1.90000e+01 2.00000e+01 ] [2.10000e+01 2.20000e+01 2.30000e+01 ]] [[2.40000e+01 2.50000e+01 2.60000e+01 ] [2.70000e+01 2.80000e+01 2.90000e+01 ] [3.00000e+01 3.10000e+01 3.20000e+01 ] [3.30000e+01 3.40000e+01 3.50000e+01 ]] [[3.60000e+01 3.70000e+01 3.80000e+01 ] [3.90000e+01 4.00000e+01 4.10000e+01 ] [4.20000e+01 4.30000e+01 4.40000e+01 ] [4.50000e+01 4.60000e+01 4.70000e+01 ]] [[4.80000e+01 4.90000e+01 5.00000e+01 ] [5.10000e+01 5.20000e+01 5.30000e+01 ] [5.40000e+01 5.50000e+01 5.60000e+01 ] [5.70000e+01 5.80000e+01 5.90000e+01 ]]]
Total elem: 60 type : Double (Float64) cytnx device: CPU Shape : (60) [0.00000e+00 1.00000e+00 2.00000e+00 3.00000e+00 4.00000e+00 5.00000e+00 6.00000e+00 7.00000e+00 8.00000e+00 9.00000e+00 1.00000e+01 1.10000e+01 1.20000e+01 1.30000e+01 1.40000e+01 1.50000e+01 1.60000e+01 1.70000e+01 1.80000e+01 1.90000e+01 2.00000e+01 2.10000e+01 2.20000e+01 2.30000e+01 2.40000e+01 2.50000e+01 2.60000e+01 2.70000e+01 2.80000e+01 2.90000e+01 3.00000e+01 3.10000e+01 3.20000e+01 3.30000e+01 3.40000e+01 3.50000e+01 3.60000e+01 3.70000e+01 3.80000e+01 3.90000e+01 4.00000e+01 4.10000e+01 4.20000e+01 4.30000e+01 4.40000e+01 4.50000e+01 4.60000e+01 4.70000e+01 4.80000e+01 4.90000e+01 5.00000e+01 5.10000e+01 5.20000e+01 5.30000e+01 5.40000e+01 5.50000e+01 5.60000e+01 5.70000e+01 5.80000e+01 5.90000e+01 ] Total elem: 60 type : Double (Float64) cytnx device: CPU Shape : (5,12) [[0.00000e+00 1.00000e+00 2.00000e+00 3.00000e+00 4.00000e+00 5.00000e+00 6.00000e+00 7.00000e+00 8.00000e+00 9.00000e+00 1.00000e+01 1.10000e+01 ] [1.20000e+01 1.30000e+01 1.40000e+01 1.50000e+01 1.60000e+01 1.70000e+01 1.80000e+01 1.90000e+01 2.00000e+01 2.10000e+01 2.20000e+01 2.30000e+01 ] [2.40000e+01 2.50000e+01 2.60000e+01 2.70000e+01 2.80000e+01 2.90000e+01 3.00000e+01 3.10000e+01 3.20000e+01 3.30000e+01 3.40000e+01 3.50000e+01 ] [3.60000e+01 3.70000e+01 3.80000e+01 3.90000e+01 4.00000e+01 4.10000e+01 4.20000e+01 4.30000e+01 4.40000e+01 4.50000e+01 4.60000e+01 4.70000e+01 ] [4.80000e+01 4.90000e+01 5.00000e+01 5.10000e+01 5.20000e+01 5.30000e+01 5.40000e+01 5.50000e+01 5.60000e+01 5.70000e+01 5.80000e+01 5.90000e+01 ]]
| bool cytnx::Tensor::same_data | ( | const Tensor & | rhs | ) | const |
| void cytnx::Tensor::Save | ( | const char * | fname | ) | const |
| void cytnx::Tensor::Save | ( | const std::string & | fname | ) | const |
|
inline |
set elements with the input constant using Accessor (C++ API) / slices (python API)
| accessors | the list(vector) of accessors. |
| rc | [Const] |
See also Tensor::fill for filling all elements with assigned constant.
Total elem: 60 type : Double (Float64) cytnx device: CPU Shape : (3,4,5) [[[0.00000e+00 1.00000e+00 2.00000e+00 3.00000e+00 4.00000e+00 ] [5.00000e+00 6.00000e+00 7.00000e+00 8.00000e+00 9.00000e+00 ] [1.00000e+01 1.10000e+01 1.20000e+01 1.30000e+01 1.40000e+01 ] [1.50000e+01 1.60000e+01 1.70000e+01 1.80000e+01 1.90000e+01 ]] [[2.00000e+01 2.10000e+01 2.20000e+01 2.30000e+01 2.40000e+01 ] [2.50000e+01 2.60000e+01 2.70000e+01 2.80000e+01 2.90000e+01 ] [3.00000e+01 3.10000e+01 3.20000e+01 3.30000e+01 3.40000e+01 ] [3.50000e+01 3.60000e+01 3.70000e+01 3.80000e+01 3.90000e+01 ]] [[4.00000e+01 4.10000e+01 4.20000e+01 4.30000e+01 4.40000e+01 ] [4.50000e+01 4.60000e+01 4.70000e+01 4.80000e+01 4.90000e+01 ] [5.00000e+01 5.10000e+01 5.20000e+01 5.30000e+01 5.40000e+01 ] [5.50000e+01 5.60000e+01 5.70000e+01 5.80000e+01 5.90000e+01 ]]] Total elem: 12 type : Double (Float64) cytnx device: CPU Shape : (4,3) [[0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 ]] Total elem: 60 type : Double (Float64) cytnx device: CPU Shape : (3,4,5) [[[0.00000e+00 1.00000e+00 2.00000e+00 3.00000e+00 4.00000e+00 ] [5.00000e+00 6.00000e+00 7.00000e+00 8.00000e+00 9.00000e+00 ] [1.00000e+01 1.10000e+01 1.20000e+01 1.30000e+01 1.40000e+01 ] [1.50000e+01 1.60000e+01 1.70000e+01 1.80000e+01 1.90000e+01 ]] [[2.00000e+01 2.10000e+01 2.20000e+01 2.30000e+01 2.40000e+01 ] [2.50000e+01 2.60000e+01 2.70000e+01 2.80000e+01 2.90000e+01 ] [3.00000e+01 3.10000e+01 3.20000e+01 3.30000e+01 3.40000e+01 ] [3.50000e+01 3.60000e+01 3.70000e+01 3.80000e+01 3.90000e+01 ]] [[4.00000e+01 4.10000e+01 0.00000e+00 0.00000e+00 0.00000e+00 ] [4.50000e+01 4.60000e+01 0.00000e+00 0.00000e+00 0.00000e+00 ] [5.00000e+01 5.10000e+01 0.00000e+00 0.00000e+00 0.00000e+00 ] [5.50000e+01 5.60000e+01 0.00000e+00 0.00000e+00 0.00000e+00 ]]] Total elem: 60 type : Double (Float64) cytnx device: CPU Shape : (3,4,5) [[[0.00000e+00 1.00000e+00 2.00000e+00 3.00000e+00 4.00000e+00 ] [5.00000e+00 6.00000e+00 7.00000e+00 8.00000e+00 9.00000e+00 ] [1.00000e+01 1.10000e+01 1.20000e+01 1.30000e+01 1.40000e+01 ] [1.50000e+01 1.60000e+01 1.70000e+01 1.80000e+01 1.90000e+01 ]] [[2.00000e+01 2.10000e+01 2.20000e+01 2.30000e+01 2.40000e+01 ] [2.50000e+01 2.60000e+01 2.70000e+01 2.80000e+01 2.90000e+01 ] [3.00000e+01 3.10000e+01 3.20000e+01 3.30000e+01 3.40000e+01 ] [3.50000e+01 3.60000e+01 3.70000e+01 3.80000e+01 3.90000e+01 ]] [[4.00000e+01 4.10000e+01 9.99000e+02 9.99000e+02 9.99000e+02 ] [4.50000e+01 4.60000e+01 9.99000e+02 9.99000e+02 9.99000e+02 ] [5.00000e+01 5.10000e+01 9.99000e+02 9.99000e+02 9.99000e+02 ] [5.50000e+01 5.60000e+01 9.99000e+02 9.99000e+02 9.99000e+02 ]]] Total elem: 60 type : Double (Float64) cytnx device: CPU Shape : (3,4,5) [[[0.00000e+00 1.00000e+00 2.00000e+00 3.00000e+00 4.00000e+00 ] [5.00000e+00 6.00000e+00 7.00000e+00 8.00000e+00 9.00000e+00 ] [1.00000e+01 1.10000e+01 1.20000e+01 1.30000e+01 1.40000e+01 ] [1.50000e+01 1.60000e+01 1.70000e+01 1.80000e+01 1.90000e+01 ]] [[2.00000e+01 2.10000e+01 2.20000e+01 2.30000e+01 2.40000e+01 ] [2.50000e+01 2.60000e+01 2.70000e+01 2.80000e+01 2.90000e+01 ] [3.00000e+01 3.10000e+01 3.20000e+01 3.30000e+01 3.40000e+01 ] [3.50000e+01 3.60000e+01 3.70000e+01 3.80000e+01 3.90000e+01 ]] [[4.00000e+01 4.10000e+01 0.00000e+00 0.00000e+00 0.00000e+00 ] [4.50000e+01 4.60000e+01 0.00000e+00 0.00000e+00 0.00000e+00 ] [5.00000e+01 5.10000e+01 0.00000e+00 0.00000e+00 0.00000e+00 ] [5.50000e+01 5.60000e+01 0.00000e+00 0.00000e+00 0.00000e+00 ]]] Total elem: 60 type : Double (Float64) cytnx device: CPU Shape : (3,4,5) [[[0.00000e+00 1.00000e+00 2.00000e+00 3.00000e+00 4.00000e+00 ] [5.00000e+00 6.00000e+00 7.00000e+00 8.00000e+00 9.00000e+00 ] [1.00000e+01 1.10000e+01 1.20000e+01 1.30000e+01 1.40000e+01 ] [1.50000e+01 1.60000e+01 1.70000e+01 1.80000e+01 1.90000e+01 ]] [[2.00000e+01 2.10000e+01 2.20000e+01 2.30000e+01 2.40000e+01 ] [2.50000e+01 2.60000e+01 2.70000e+01 2.80000e+01 2.90000e+01 ] [3.00000e+01 3.10000e+01 3.20000e+01 3.30000e+01 3.40000e+01 ] [3.50000e+01 3.60000e+01 3.70000e+01 3.80000e+01 3.90000e+01 ]] [[9.99000e+02 9.99000e+02 0.00000e+00 0.00000e+00 0.00000e+00 ] [9.99000e+02 9.99000e+02 0.00000e+00 0.00000e+00 0.00000e+00 ] [9.99000e+02 9.99000e+02 0.00000e+00 0.00000e+00 0.00000e+00 ] [9.99000e+02 9.99000e+02 0.00000e+00 0.00000e+00 0.00000e+00 ]]]
Total elem: 60 type : Double (Float64) cytnx device: CPU Shape : (3,4,5) [[[0.00000e+00 1.00000e+00 2.00000e+00 3.00000e+00 4.00000e+00 ] [5.00000e+00 6.00000e+00 7.00000e+00 8.00000e+00 9.00000e+00 ] [1.00000e+01 1.10000e+01 1.20000e+01 1.30000e+01 1.40000e+01 ] [1.50000e+01 1.60000e+01 1.70000e+01 1.80000e+01 1.90000e+01 ]] [[2.00000e+01 2.10000e+01 2.20000e+01 2.30000e+01 2.40000e+01 ] [2.50000e+01 2.60000e+01 2.70000e+01 2.80000e+01 2.90000e+01 ] [3.00000e+01 3.10000e+01 3.20000e+01 3.30000e+01 3.40000e+01 ] [3.50000e+01 3.60000e+01 3.70000e+01 3.80000e+01 3.90000e+01 ]] [[4.00000e+01 4.10000e+01 4.20000e+01 4.30000e+01 4.40000e+01 ] [4.50000e+01 4.60000e+01 4.70000e+01 4.80000e+01 4.90000e+01 ] [5.00000e+01 5.10000e+01 5.20000e+01 5.30000e+01 5.40000e+01 ] [5.50000e+01 5.60000e+01 5.70000e+01 5.80000e+01 5.90000e+01 ]]] Total elem: 12 type : Double (Float64) cytnx device: CPU Shape : (4,3) [[0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 ]] Total elem: 60 type : Double (Float64) cytnx device: CPU Shape : (3,4,5) [[[0.00000e+00 1.00000e+00 2.00000e+00 3.00000e+00 4.00000e+00 ] [5.00000e+00 6.00000e+00 7.00000e+00 8.00000e+00 9.00000e+00 ] [1.00000e+01 1.10000e+01 1.20000e+01 1.30000e+01 1.40000e+01 ] [1.50000e+01 1.60000e+01 1.70000e+01 1.80000e+01 1.90000e+01 ]] [[2.00000e+01 2.10000e+01 2.20000e+01 2.30000e+01 2.40000e+01 ] [2.50000e+01 2.60000e+01 2.70000e+01 2.80000e+01 2.90000e+01 ] [3.00000e+01 3.10000e+01 3.20000e+01 3.30000e+01 3.40000e+01 ] [3.50000e+01 3.60000e+01 3.70000e+01 3.80000e+01 3.90000e+01 ]] [[4.00000e+01 4.10000e+01 0.00000e+00 0.00000e+00 0.00000e+00 ] [4.50000e+01 4.60000e+01 0.00000e+00 0.00000e+00 0.00000e+00 ] [5.00000e+01 5.10000e+01 0.00000e+00 0.00000e+00 0.00000e+00 ] [5.50000e+01 5.60000e+01 0.00000e+00 0.00000e+00 0.00000e+00 ]]] Total elem: 60 type : Double (Float64) cytnx device: CPU Shape : (3,4,5) [[[9.99000e+02 9.99000e+02 2.00000e+00 3.00000e+00 4.00000e+00 ] [9.99000e+02 9.99000e+02 7.00000e+00 8.00000e+00 9.00000e+00 ] [9.99000e+02 9.99000e+02 1.20000e+01 1.30000e+01 1.40000e+01 ] [9.99000e+02 9.99000e+02 1.70000e+01 1.80000e+01 1.90000e+01 ]] [[2.00000e+01 2.10000e+01 2.20000e+01 2.30000e+01 2.40000e+01 ] [2.50000e+01 2.60000e+01 2.70000e+01 2.80000e+01 2.90000e+01 ] [3.00000e+01 3.10000e+01 3.20000e+01 3.30000e+01 3.40000e+01 ] [3.50000e+01 3.60000e+01 3.70000e+01 3.80000e+01 3.90000e+01 ]] [[4.00000e+01 4.10000e+01 0.00000e+00 0.00000e+00 0.00000e+00 ] [4.50000e+01 4.60000e+01 0.00000e+00 0.00000e+00 0.00000e+00 ] [5.00000e+01 5.10000e+01 0.00000e+00 0.00000e+00 0.00000e+00 ] [5.50000e+01 5.60000e+01 0.00000e+00 0.00000e+00 0.00000e+00 ]]]
|
inline |
set elements with the input Tensor using Accessor (C++ API) / slices (python API)
| accessors | the list(vector) of accessors. |
| rhs | [Tensor] |
the shape of the input Tensor should be the same as the shape that indicated using Accessor. The memory is not shared with the input Tensor.
Total elem: 60 type : Double (Float64) cytnx device: CPU Shape : (3,4,5) [[[0.00000e+00 1.00000e+00 2.00000e+00 3.00000e+00 4.00000e+00 ] [5.00000e+00 6.00000e+00 7.00000e+00 8.00000e+00 9.00000e+00 ] [1.00000e+01 1.10000e+01 1.20000e+01 1.30000e+01 1.40000e+01 ] [1.50000e+01 1.60000e+01 1.70000e+01 1.80000e+01 1.90000e+01 ]] [[2.00000e+01 2.10000e+01 2.20000e+01 2.30000e+01 2.40000e+01 ] [2.50000e+01 2.60000e+01 2.70000e+01 2.80000e+01 2.90000e+01 ] [3.00000e+01 3.10000e+01 3.20000e+01 3.30000e+01 3.40000e+01 ] [3.50000e+01 3.60000e+01 3.70000e+01 3.80000e+01 3.90000e+01 ]] [[4.00000e+01 4.10000e+01 4.20000e+01 4.30000e+01 4.40000e+01 ] [4.50000e+01 4.60000e+01 4.70000e+01 4.80000e+01 4.90000e+01 ] [5.00000e+01 5.10000e+01 5.20000e+01 5.30000e+01 5.40000e+01 ] [5.50000e+01 5.60000e+01 5.70000e+01 5.80000e+01 5.90000e+01 ]]] Total elem: 12 type : Double (Float64) cytnx device: CPU Shape : (4,3) [[0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 ]] Total elem: 60 type : Double (Float64) cytnx device: CPU Shape : (3,4,5) [[[0.00000e+00 1.00000e+00 2.00000e+00 3.00000e+00 4.00000e+00 ] [5.00000e+00 6.00000e+00 7.00000e+00 8.00000e+00 9.00000e+00 ] [1.00000e+01 1.10000e+01 1.20000e+01 1.30000e+01 1.40000e+01 ] [1.50000e+01 1.60000e+01 1.70000e+01 1.80000e+01 1.90000e+01 ]] [[2.00000e+01 2.10000e+01 2.20000e+01 2.30000e+01 2.40000e+01 ] [2.50000e+01 2.60000e+01 2.70000e+01 2.80000e+01 2.90000e+01 ] [3.00000e+01 3.10000e+01 3.20000e+01 3.30000e+01 3.40000e+01 ] [3.50000e+01 3.60000e+01 3.70000e+01 3.80000e+01 3.90000e+01 ]] [[4.00000e+01 4.10000e+01 0.00000e+00 0.00000e+00 0.00000e+00 ] [4.50000e+01 4.60000e+01 0.00000e+00 0.00000e+00 0.00000e+00 ] [5.00000e+01 5.10000e+01 0.00000e+00 0.00000e+00 0.00000e+00 ] [5.50000e+01 5.60000e+01 0.00000e+00 0.00000e+00 0.00000e+00 ]]] Total elem: 60 type : Double (Float64) cytnx device: CPU Shape : (3,4,5) [[[0.00000e+00 1.00000e+00 2.00000e+00 3.00000e+00 4.00000e+00 ] [5.00000e+00 6.00000e+00 7.00000e+00 8.00000e+00 9.00000e+00 ] [1.00000e+01 1.10000e+01 1.20000e+01 1.30000e+01 1.40000e+01 ] [1.50000e+01 1.60000e+01 1.70000e+01 1.80000e+01 1.90000e+01 ]] [[2.00000e+01 2.10000e+01 2.20000e+01 2.30000e+01 2.40000e+01 ] [2.50000e+01 2.60000e+01 2.70000e+01 2.80000e+01 2.90000e+01 ] [3.00000e+01 3.10000e+01 3.20000e+01 3.30000e+01 3.40000e+01 ] [3.50000e+01 3.60000e+01 3.70000e+01 3.80000e+01 3.90000e+01 ]] [[4.00000e+01 4.10000e+01 9.99000e+02 9.99000e+02 9.99000e+02 ] [4.50000e+01 4.60000e+01 9.99000e+02 9.99000e+02 9.99000e+02 ] [5.00000e+01 5.10000e+01 9.99000e+02 9.99000e+02 9.99000e+02 ] [5.50000e+01 5.60000e+01 9.99000e+02 9.99000e+02 9.99000e+02 ]]] Total elem: 60 type : Double (Float64) cytnx device: CPU Shape : (3,4,5) [[[0.00000e+00 1.00000e+00 2.00000e+00 3.00000e+00 4.00000e+00 ] [5.00000e+00 6.00000e+00 7.00000e+00 8.00000e+00 9.00000e+00 ] [1.00000e+01 1.10000e+01 1.20000e+01 1.30000e+01 1.40000e+01 ] [1.50000e+01 1.60000e+01 1.70000e+01 1.80000e+01 1.90000e+01 ]] [[2.00000e+01 2.10000e+01 2.20000e+01 2.30000e+01 2.40000e+01 ] [2.50000e+01 2.60000e+01 2.70000e+01 2.80000e+01 2.90000e+01 ] [3.00000e+01 3.10000e+01 3.20000e+01 3.30000e+01 3.40000e+01 ] [3.50000e+01 3.60000e+01 3.70000e+01 3.80000e+01 3.90000e+01 ]] [[4.00000e+01 4.10000e+01 0.00000e+00 0.00000e+00 0.00000e+00 ] [4.50000e+01 4.60000e+01 0.00000e+00 0.00000e+00 0.00000e+00 ] [5.00000e+01 5.10000e+01 0.00000e+00 0.00000e+00 0.00000e+00 ] [5.50000e+01 5.60000e+01 0.00000e+00 0.00000e+00 0.00000e+00 ]]] Total elem: 60 type : Double (Float64) cytnx device: CPU Shape : (3,4,5) [[[0.00000e+00 1.00000e+00 2.00000e+00 3.00000e+00 4.00000e+00 ] [5.00000e+00 6.00000e+00 7.00000e+00 8.00000e+00 9.00000e+00 ] [1.00000e+01 1.10000e+01 1.20000e+01 1.30000e+01 1.40000e+01 ] [1.50000e+01 1.60000e+01 1.70000e+01 1.80000e+01 1.90000e+01 ]] [[2.00000e+01 2.10000e+01 2.20000e+01 2.30000e+01 2.40000e+01 ] [2.50000e+01 2.60000e+01 2.70000e+01 2.80000e+01 2.90000e+01 ] [3.00000e+01 3.10000e+01 3.20000e+01 3.30000e+01 3.40000e+01 ] [3.50000e+01 3.60000e+01 3.70000e+01 3.80000e+01 3.90000e+01 ]] [[9.99000e+02 9.99000e+02 0.00000e+00 0.00000e+00 0.00000e+00 ] [9.99000e+02 9.99000e+02 0.00000e+00 0.00000e+00 0.00000e+00 ] [9.99000e+02 9.99000e+02 0.00000e+00 0.00000e+00 0.00000e+00 ] [9.99000e+02 9.99000e+02 0.00000e+00 0.00000e+00 0.00000e+00 ]]]
Total elem: 60 type : Double (Float64) cytnx device: CPU Shape : (3,4,5) [[[0.00000e+00 1.00000e+00 2.00000e+00 3.00000e+00 4.00000e+00 ] [5.00000e+00 6.00000e+00 7.00000e+00 8.00000e+00 9.00000e+00 ] [1.00000e+01 1.10000e+01 1.20000e+01 1.30000e+01 1.40000e+01 ] [1.50000e+01 1.60000e+01 1.70000e+01 1.80000e+01 1.90000e+01 ]] [[2.00000e+01 2.10000e+01 2.20000e+01 2.30000e+01 2.40000e+01 ] [2.50000e+01 2.60000e+01 2.70000e+01 2.80000e+01 2.90000e+01 ] [3.00000e+01 3.10000e+01 3.20000e+01 3.30000e+01 3.40000e+01 ] [3.50000e+01 3.60000e+01 3.70000e+01 3.80000e+01 3.90000e+01 ]] [[4.00000e+01 4.10000e+01 4.20000e+01 4.30000e+01 4.40000e+01 ] [4.50000e+01 4.60000e+01 4.70000e+01 4.80000e+01 4.90000e+01 ] [5.00000e+01 5.10000e+01 5.20000e+01 5.30000e+01 5.40000e+01 ] [5.50000e+01 5.60000e+01 5.70000e+01 5.80000e+01 5.90000e+01 ]]] Total elem: 12 type : Double (Float64) cytnx device: CPU Shape : (4,3) [[0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 ] [0.00000e+00 0.00000e+00 0.00000e+00 ]] Total elem: 60 type : Double (Float64) cytnx device: CPU Shape : (3,4,5) [[[0.00000e+00 1.00000e+00 2.00000e+00 3.00000e+00 4.00000e+00 ] [5.00000e+00 6.00000e+00 7.00000e+00 8.00000e+00 9.00000e+00 ] [1.00000e+01 1.10000e+01 1.20000e+01 1.30000e+01 1.40000e+01 ] [1.50000e+01 1.60000e+01 1.70000e+01 1.80000e+01 1.90000e+01 ]] [[2.00000e+01 2.10000e+01 2.20000e+01 2.30000e+01 2.40000e+01 ] [2.50000e+01 2.60000e+01 2.70000e+01 2.80000e+01 2.90000e+01 ] [3.00000e+01 3.10000e+01 3.20000e+01 3.30000e+01 3.40000e+01 ] [3.50000e+01 3.60000e+01 3.70000e+01 3.80000e+01 3.90000e+01 ]] [[4.00000e+01 4.10000e+01 0.00000e+00 0.00000e+00 0.00000e+00 ] [4.50000e+01 4.60000e+01 0.00000e+00 0.00000e+00 0.00000e+00 ] [5.00000e+01 5.10000e+01 0.00000e+00 0.00000e+00 0.00000e+00 ] [5.50000e+01 5.60000e+01 0.00000e+00 0.00000e+00 0.00000e+00 ]]] Total elem: 60 type : Double (Float64) cytnx device: CPU Shape : (3,4,5) [[[9.99000e+02 9.99000e+02 2.00000e+00 3.00000e+00 4.00000e+00 ] [9.99000e+02 9.99000e+02 7.00000e+00 8.00000e+00 9.00000e+00 ] [9.99000e+02 9.99000e+02 1.20000e+01 1.30000e+01 1.40000e+01 ] [9.99000e+02 9.99000e+02 1.70000e+01 1.80000e+01 1.90000e+01 ]] [[2.00000e+01 2.10000e+01 2.20000e+01 2.30000e+01 2.40000e+01 ] [2.50000e+01 2.60000e+01 2.70000e+01 2.80000e+01 2.90000e+01 ] [3.00000e+01 3.10000e+01 3.20000e+01 3.30000e+01 3.40000e+01 ] [3.50000e+01 3.60000e+01 3.70000e+01 3.80000e+01 3.90000e+01 ]] [[4.00000e+01 4.10000e+01 0.00000e+00 0.00000e+00 0.00000e+00 ] [4.50000e+01 4.60000e+01 0.00000e+00 0.00000e+00 0.00000e+00 ] [5.00000e+01 5.10000e+01 0.00000e+00 0.00000e+00 0.00000e+00 ] [5.50000e+01 5.60000e+01 0.00000e+00 0.00000e+00 0.00000e+00 ]]]
|
inline |
|
inline |
return the storage of current Tensor.
|
inline |
|
inline |
| std::vector< Tensor > cytnx::Tensor::Svd | ( | const bool & | is_U = true, |
| const bool & | is_vT = true |
||
| ) | const |
|
inline |
copy a tensor to new device
| device | the device-id that is moving to. it can be any device defined in cytnx::Device |
description:
if the device-id is the same as current Tensor's device, then return self.
otherwise, return a copy of instance that located on the target device.
see also: Tensor.to_
cytnx device: CUDA/GPU-id:0 cytnx device: CPU
cytnx device: CUDA/GPU-id:0 cytnx device: CPU
|
inline |
move the current Tensor to the device.
| device | the device-id that is moving to. it can be any device defined in cytnx::Device |
description:
see also: Tensor.to
cytnx device: CUDA/GPU-id:0
cytnx device: CUDA/GPU-id:0
| void cytnx::Tensor::Tofile | ( | const char * | fname | ) | const |
| void cytnx::Tensor::Tofile | ( | const std::string & | fname | ) | const |
| void cytnx::Tensor::Tofile | ( | std::fstream & | f | ) | const |
| Tensor cytnx::Tensor::Trace | ( | const cytnx_uint64 & | a = 0, |
| const cytnx_uint64 & | b = 1 |
||
| ) | const |