Skip to content

Layer : Tile

yaitaissa edited this page Aug 30, 2024 · 2 revisions

Repeat the tensor alongside each dimensions.

Inputs

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

  • repeats (list[int]): list of the same length as the rank of T (4) indicating the number of repeated copies alongside each dimension

Outputs

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

The size of Y can be find with: $(N,C_Y,H_Y,W_Y)⁼(N.repeats[0],C_T.repeats[1],H_T.repeats[2],W_T.repeats[3])$

Output's values computing

  • indice $(z_Y,x_Y, y_Y)$ of the output tensor
  • Find the coordinate in the input tensor : $(z_T,x_T,y_T) = (z_Y$ % $C_T,x_Y$ % $H_T, y_Y$ % $W_T)$
  • Take the corresponding value: $Y(z_Y,x_Y, y_Y) = T(z_T,x_T,y_T)$

With % begin the modula function (a%b is the rest of the euclidian division of a by b).

Clone this wiki locally