Txeo v0.1
A Developer-Friendly TensorFlow C++ Wrapper
Loading...
Searching...
No Matches
TensorPart.h
Go to the documentation of this file.
1#ifndef TENSORPART_H
2#define TENSORPART_H
3#pragma once
4
5#include "txeo/Matrix.h"
6#include "txeo/Tensor.h"
7
8#include <cstddef>
9#include <stdexcept>
10#include <vector>
11
12namespace txeo {
13
23template <typename T>
25 public:
26 TensorPart(const TensorPart &) = delete;
27 TensorPart(TensorPart &&) = delete;
28 TensorPart &operator=(const TensorPart &) = delete;
31
78 static std::vector<txeo::Tensor<T>> unstack(const txeo::Tensor<T> &tensor, size_t axis);
79
105 size_t first_axis_end);
106
125
144
163 const std::vector<size_t> &cols);
164
184 const std::vector<size_t> &cols);
185
205 const std::vector<size_t> &rows);
206
207 private:
208 TensorPart() = default;
209};
210
215class TensorPartError : public std::runtime_error {
216 public:
217 using std::runtime_error::runtime_error;
218};
219
220} // namespace txeo
221
222#endif
A container for managing training, evaluation, and test data splits.
Definition DataTable.h:24
Exceptions concerning txeo::Tensor.
Definition TensorPart.h:215
A utility class for partitioning tensors.
Definition TensorPart.h:24
static txeo::Tensor< T > & increase_dimension_by(txeo::Tensor< T > &tensor, size_t axis, T value)
Increments the dimension of the tensor at the specified axis (in-place)
TensorPart & operator=(const TensorPart &)=delete
static txeo::Tensor< T > slice(const txeo::Tensor< T > &tensor, size_t first_axis_begin, size_t first_axis_end)
Returns a view of the tensor from a specified range of dimensions of the first axis.
static txeo::Matrix< T > sub_matrix_cols_exclude(const txeo::Matrix< T > &matrix, const std::vector< size_t > &cols)
Creates a submatrix excluding the specified columns.
TensorPart(const TensorPart &)=delete
static txeo::Tensor< T > increase_dimension(const txeo::Tensor< T > &tensor, size_t axis, T value)
Increments the dimension of the tensor at the specified axis.
static txeo::Matrix< T > sub_matrix_cols(const txeo::Matrix< T > &matrix, const std::vector< size_t > &cols)
Creates a submatrix containing specified columns.
static txeo::Matrix< T > sub_matrix_rows(const txeo::Matrix< T > &matrix, const std::vector< size_t > &rows)
Creates a submatrix containing specified rows.
TensorPart & operator=(TensorPart &&)=delete
static std::vector< txeo::Tensor< T > > unstack(const txeo::Tensor< T > &tensor, size_t axis)
Unstacks a tensor along a specified axis into a list of tensors.
TensorPart(TensorPart &&)=delete