177 [[nodiscard]]
const std::vector<size_t> &
stride()
const;
184 [[nodiscard]] std::vector<int64_t>
axes_dims() const noexcept;
308 std::unique_ptr<Impl> _impl{
nullptr};
310 template <
typename T>
313 template <
typename T>
316 template <
typename T>
321 template <
typename P>
322 void create_from_vector(P &&shape);
333 using std::runtime_error::runtime_error;
Class that deals with the main tasks of prediction (inference)
A utility class for aggregation functions on tensors.
Implements the mathematical concept of tensor, which is a magnitude of multiple order....
Exceptions concerning txeo::TensorShape.
The shape of a tensor is an ordered collection of dimensions of mathematical vector spaces.
TensorShape(int number_of_axes, size_t dim)
Constructs a tensor shape with axes having the same dimension.
TensorShape clone() const
Returns a clone of this tensor.
bool operator!=(const TensorShape &shape) const
void remove_axis(int axis)
Removes a specified axis.
TensorShape(TensorShape &&shape) noexcept
int number_of_axes() const noexcept
Returns the size of the tensor shape.
TensorShape(const TensorShape &shape)
friend class txeo::detail::TensorHelper
void insert_axis(int axis, size_t dim)
Inserts a dimension at the specified axis.
TensorShape & operator=(const TensorShape &shape)
TensorShape & operator=(TensorShape &&shape) noexcept
int64_t axis_dim(int axis) const
Returns the dimension of the specified axis.
int size() const noexcept
Synonym for txeo::TensorShape::number_of_axes()
std::vector< int64_t > axes_dims() const noexcept
Returns the collection of tensor shape dimensions.
friend std::ostream & operator<<(std::ostream &os, const TensorShape &shape)
void push_axis_back(size_t dim)
Inserts a dimension after the last axis.
size_t calculate_capacity() const noexcept
Calculates the number of available tensor elements specified by the tensor shape.
void remove_all_axes()
Removes all axes from this shape, resulting an empty shape.
bool operator==(const TensorShape &shape) const
void set_dim(int axis, size_t dim)
Sets a dimension in a specified axis.
TensorShape(std::vector< size_t > &&shape)
Constructs a tensor shape from a std::vector.
TensorShape(const std::initializer_list< size_t > &shape)
Constructs a tensor shape from an initializer list.
TensorShape(const std::vector< size_t > &shape)
Constructs a tensor shape from a std::vector.
const std::vector< size_t > & stride() const
Returns the stride of each dimension in the tensor.
bool is_fully_defined() const noexcept
Indicates whether the tensor shape has any negative(undefined) dimensions or not.