Skip to content

Layer : Transpose

yaitaissa edited this page Aug 30, 2024 · 3 revisions

The Transpose layer performs the transposition of the input tensor according to the attributs.

How the layer works

Inputs

  • T tensor of size $(N,C_T,H_T,W_T)$

Attributs

  • perm (list[int]): indicate how to permute the dimension. Its length must be equal to the rank of T (4).

Outputs

  • Y tensor of size $(N,C_Y,H_Y,W_Y)$

Output's values computing

  • indice $indice_Y=(z_Y,x_Y, y_Y)$ of the output tensor
  • Find the coordinate in the input tensor : $(z_T,x_T,y_T) = (indice_Y[perm[1]],indice_Y[perm[2]],indice_Y[perm[3]])$
  • Take the corresponding value: $Y(z_Y,x_Y, y_Y) = T(z_T,x_T,y_T)$

Clone this wiki locally