24#include "tensorptr.hpp"
262 [[nodiscard]]
bool operator==(
const TensorPtr& left,
const TensorPtr& right)
noexcept;
264 allclose(
const TensorPtr& left,
const TensorPtr& right,
float rtol = 1e-5,
float atol = 1e-8) noexcept;
273 [[nodiscard]]
size_t numEntries(const
TensorPtr& tensor) noexcept;
The Tensor is a managed pointer to a tensor. It can generally be thought of like an std::unique_ptr<T...
TensorPtr exp(TensorPtr x) noexcept
Computes the elementwise x -th power of e.
TensorPtr pow(TensorPtr base, float exponent) noexcept
Computes the exponent -th power of each element in base and returns the resulting tensor.
TensorPtr rsqrt(TensorPtr x) noexcept
Computes the reciprocal square root for each element in x.
TensorPtr sqrt(TensorPtr x) noexcept
Computes the elementwise square root of x .
TensorPtr log(TensorPtr x) noexcept
Natural logarithm, .
TensorPtr erf(TensorPtr x) noexcept
(Gauss) Error Function
TensorPtr mean(TensorPtr x) noexcept
Mean.
TensorPtr var(TensorPtr x, DOF dof=DOF{1}) noexcept
Variance.
TensorPtr sum(TensorPtr x) noexcept
Sum.
TensorPtr max(TensorPtr x) noexcept
Maximum.
TensorPtr min(TensorPtr x) noexcept
Minimum.
TensorPtr softmax(TensorPtr x) noexcept
Computes the softmax function of the input vector.
TensorPtr transpose(TensorPtr x, std::vector< int > &&permutation) noexcept
Transposes the given tensor at the specified coordinates.
Wrapper around std::size_t to discern between var(TensorPtr, DOF) and var(TensorPtr,...