iVS3D v2.0.0
Loading...
Searching...
No Matches
Tensor.h File Reference

Contains the Tensor class for representing N-dimensional arrays with various data types. More...

#include <variant>
#include <vector>
#include <cstdint>
#include <string>
#include <cmath>
#include <numeric>
#include <iostream>
#include <sstream>
#include <array>
#include <type_traits>
#include <utility>
#include <opencv2/core.hpp>
#include <opencv2/imgproc.hpp>
#include <tl/expected.hpp>
#include <ReduceOps.h>
#include "NeuralError.h"

Go to the source code of this file.

Classes

struct  NN::is_std_array< T >
 Checks if a type is a std::array. More...
 
struct  NN::is_std_array< std::array< U, N > >
 
struct  NN::map_array_traits< Func, InputElem >
 Traits for mapping a function over a std::array. More...
 
class  NN::Tensor
 A Tensor represents a N-dimensional array containing elements of the same type. Can be used as input and output for inference. More...
 

Namespaces

namespace  NN
 NN Neural Network Library containing Tensor and NeuralNet classes for inference.
 

Typedefs

using NN::Shape = std::vector< int64_t >
 Shape of a N-dimensional Tensor represented as the size in each dimension. Can be -1 in case of dynamic dimensions.
 
template<typename T >
using NN::decay_t = typename std::decay< T >::type
 Remove cv/ref qualifiers and decay to check std::array<T, N>
 

Enumerations

enum class  NN::TensorType
 TensorType encapsulates the supported data types of tensor elements. The supported types are: More...
 

Functions

int64_t NN::shapeNumElements (const Shape &shape)
 Calculates the number of elements from a given Shape.
 
int64_t NN::shapeToStride (const Shape &shape, uint64_t axis)
 Calculates the stride to iterate elements in a given axis.
 
std::string NN::shapeToString (const Shape &shape)
 Creates a human-readable string from the given shape.
 
constexpr const char * NN::toString (TensorType type)
 Convert the TensorType to a human-readable string.
 

Detailed Description

Contains the Tensor class for representing N-dimensional arrays with various data types.

Author
Dominik Wüst (domin.nosp@m.ik.w.nosp@m.uest@.nosp@m.iosb.nosp@m..frau.nosp@m.nhof.nosp@m.er.de)
Date
May 2025