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

Repack operation (makes a tensor contiguous in memory) More...

#include <transformations.hpp>

Public Member Functions

constexpr type promote (type dtype) const
 Type promotion for repack.
 
constexpr Shape transform (Shape const &shape) const
 Computes output shape after repack.
 
void forward (Tensor const &source, Tensor &result) const
 Copies the tensor data to a contiguous layout if needed.
 

Detailed Description

Repack operation (makes a tensor contiguous in memory)

Ensures the tensor is stored contiguously (row-major order). Does not change shape or dtype.

Member Function Documentation

◆ forward()

void tannic::transformation::Repack::forward ( Tensor const &  source,
Tensor result 
) const

Copies the tensor data to a contiguous layout if needed.

Parameters
sourceInput tensor.
resultOutput tensor with contiguous layout.

◆ promote()

constexpr type tannic::transformation::Repack::promote ( type  dtype) const
inlineconstexpr

Type promotion for repack.

Repack does not change dtype.

◆ transform()

constexpr Shape tannic::transformation::Repack::transform ( Shape const &  shape) const
inlineconstexpr

Computes output shape after repack.

Repack does not change the shape.


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