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/Tensor.h"
6
7namespace txeo {
8
18template <typename T>
20 public:
21 TensorPart(const TensorPart &) = delete;
22 TensorPart(TensorPart &&) = delete;
23 TensorPart &operator=(const TensorPart &) = delete;
26
73 static std::vector<txeo::Tensor<T>> unstack(const txeo::Tensor<T> &tensor, size_t axis);
74
99 static txeo::Tensor<T> slice(const txeo::Tensor<T> &tensor, size_t first_axis_begin,
100 size_t first_axis_end);
101
102 private:
103 TensorPart() = default;
104};
105
110class TensorPartError : public std::runtime_error {
111 public:
112 using std::runtime_error::runtime_error;
113};
114
115} // namespace txeo
116
117#endif
Implements the mathematical concept of tensor, which is a magnitude of multiple order....
Definition Tensor.h:48
Exceptions concerning txeo::Tensor.
Definition TensorPart.h:110
A utility class for partitioning tensors.
Definition TensorPart.h:19
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.
TensorPart(const TensorPart &)=delete
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
Definition Matrix.h:11