3#include "../layernorm.hpp"
4#include "../linear.hpp"
20 constexpr double calcPosEncoding(
size_t pos,
size_t i,
size_t dimModel) {
Implements layer normalization as proposed by .
Applies a learnable linear transformation with optional bias.
The Tensor is a managed pointer to a tensor. It can generally be thought of like an std::unique_ptr<T...
TensorPtr pow(TensorPtr base, float exponent) noexcept
Computes the exponent -th power of each element in base and returns the resulting tensor.