Cytnx v1.0.0
Loading...
Searching...
No Matches
algo.hpp
Go to the documentation of this file.
1#ifndef CYTNX_ALGO_H_
2#define CYTNX_ALGO_H_
3
4#include "Type.hpp"
5#include "cytnx_error.hpp"
6#include "Tensor.hpp"
7
8#ifdef BACKEND_TORCH
9#else
10
11namespace cytnx {
16 namespace algo {
17
23 Tensor Sort(const Tensor &Tin);
24
39
68 Tensor Vstack(const std::vector<Tensor> &In_tensors);
69
96 Tensor Hstack(const std::vector<Tensor> &In_tensors);
97
108 void Vsplit_(std::vector<Tensor> &out, const Tensor &Tin,
109 const std::vector<cytnx_uint64> &dims);
110
121 void Hsplit_(std::vector<Tensor> &out, const Tensor &Tin,
122 const std::vector<cytnx_uint64> &dims);
123
162 std::vector<Tensor> Vsplit(const Tensor &Tin, const std::vector<cytnx_uint64> &dims);
163
205 std::vector<Tensor> Hsplit(const Tensor &Tin, const std::vector<cytnx_uint64> &dims);
206
208 Tensor _fx_Matric_combine(std::vector<Tensor> &Tlist, const cytnx_uint64 &Row_Nblk,
209 const cytnx_uint64 &Col_Nblk);
210 void _fx_Matric_split(std::vector<Tensor> &out, const Tensor &Tin,
211 const std::vector<cytnx_uint64> &rdims,
212 const std::vector<cytnx_uint64> &cdims);
214
215 } // namespace algo
216} // namespace cytnx
217#endif // BACKEND_TORCH
218
219#endif // CYTNX_ALGO_H_
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.
Definition Accessor.hpp:12