Tannic
A C++ Tensor Library
Loading...
Searching...
No Matches
tannic::transformation::Concatenation Struct Reference

Concatenation operation along a specified axis. More...

#include <transformations.hpp>

Public Member Functions

constexpr auto promote (type first, type second) const
 Type promotion for concatenation.
 
constexpr Shape transform (Shape const &first, Shape const &second)
 Computes output shape after concatenation.
 
void forward (Tensor const &, Tensor const &, Tensor &) const
 

Public Attributes

int axis
 

Detailed Description

Concatenation operation along a specified axis.

Concatenates two tensors of the same rank and dtype along a given axis.

Member Function Documentation

◆ forward()

void tannic::transformation::Concatenation::forward ( Tensor const &  ,
Tensor const &  ,
Tensor  
) const

◆ promote()

constexpr auto tannic::transformation::Concatenation::promote ( type  first,
type  second 
) const
inlineconstexpr

Type promotion for concatenation.

Requires both tensors to have identical data types.

Parameters
firstLeft tensor dtype.
secondRight tensor dtype.
Returns
Data type (same as inputs).

◆ transform()

constexpr Shape tannic::transformation::Concatenation::transform ( Shape const &  first,
Shape const &  second 
)
inlineconstexpr

Computes output shape after concatenation.

Validates that all dimensions except the concatenation axis are equal. Output shape is input shapes with concatenation axis dimension summed.

Parameters
firstLeft tensor shape.
secondRight tensor shape.
Returns
Output shape after concatenation.

Member Data Documentation

◆ axis

int tannic::transformation::Concatenation::axis

The documentation for this struct was generated from the following file: