Cytnx v0.9.4
Loading...
Searching...
No Matches
algo.hpp
Go to the documentation of this file.
1#ifndef _algo_H_
2#define _algo_H_
3#include "Type.hpp"
4#include "cytnx_error.hpp"
5#include "Tensor.hpp"
6
7#ifdef BACKEND_TORCH
8#else
9
10namespace cytnx {
15 namespace algo {
16
22 Tensor Sort(const Tensor &Tin);
23
38
67 Tensor Vstack(const std::vector<Tensor> &In_tensors);
68
95 Tensor Hstack(const std::vector<Tensor> &In_tensors);
96
107 void Vsplit_(std::vector<Tensor> &out, const Tensor &Tin,
108 const std::vector<cytnx_uint64> &dims);
109
120 void Hsplit_(std::vector<Tensor> &out, const Tensor &Tin,
121 const std::vector<cytnx_uint64> &dims);
122
161 std::vector<Tensor> Vsplit(const Tensor &Tin, const std::vector<cytnx_uint64> &dims);
162
204 std::vector<Tensor> Hsplit(const Tensor &Tin, const std::vector<cytnx_uint64> &dims);
205
207 Tensor _fx_Matric_combine(std::vector<Tensor> &Tlist, const cytnx_uint64 &Row_Nblk,
208 const cytnx_uint64 &Col_Nblk);
209 void _fx_Matric_split(std::vector<Tensor> &out, const Tensor &Tin,
210 const std::vector<cytnx_uint64> &rdims,
211 const std::vector<cytnx_uint64> &cdims);
213
214 } // namespace algo
215} // namespace cytnx
216#endif // BACKEND_TORCH
217
218#endif
an tensor (multi-dimensional array)
Definition Tensor.hpp:41
void Hsplit_(std::vector< Tensor > &out, const Tensor &Tin, const std::vector< cytnx_uint64 > &dims)
split a Matrix (a 2d Tensor) into a list of Matrices along the horizontal direction.
Tensor Concatenate(Tensor T1, Tensor T2)
concatenate two 1d Tensor.
void Vsplit_(std::vector< Tensor > &out, const Tensor &Tin, const std::vector< cytnx_uint64 > &dims)
split a Matrix (a 2d Tensor) into a list of Matrices along the vertical direction.
Tensor Sort(const Tensor &Tin)
sort Tensor along last axis.
std::vector< Tensor > Hsplit(const Tensor &Tin, const std::vector< cytnx_uint64 > &dims)
split a Matrix (a 2d Tensor) into a list of Matrices along the horizontal direction.
std::vector< Tensor > Vsplit(const Tensor &Tin, const std::vector< cytnx_uint64 > &dims)
split a Matrix (a 2d Tensor) into a list of Matrices along the vertical direction.
Tensor Vstack(const std::vector< Tensor > &In_tensors)
vertical stack a list of Tensor.
Tensor Hstack(const std::vector< Tensor > &In_tensors)
horizontal stack a list of Tensor.
Helper function to print vector with ODT:
Definition Accessor.hpp:12
uint64_t cytnx_uint64
Definition Type.hpp:55