The possible values to specify the Padding option of a PaddingLayer include a fixed value, "Fixed" for a repetition of the last value, and "Reflected" for a reflection of the input... but I see no way to achieve a periodic padding, which would be equally reasonable (and is possible e.g. in ArrayPad). Maybe this is hidden, or can be achieved in a Neural Network in some other way?

For concretenes, I'm looking for something like

(*{10,1,2,3,4,5,6,7,8,9,10,1,2}*)

This is not a very elegant approach but it does the job in your example and might get you started.

I am using

\$Version

"12.0.0 for Linux x86 (64-bit) (April 7, 2019)"

Let's begin by getting the list you described using the ArrayPad

Let's create your list

list = Range@10;

pad = {{1, 2}};

and the we do

which yields

{10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2}

In order to achieve the same thing using PaddingLayer the only way I could come up with is the following:

For a new pad given by

pad = {{1, 1}};

we run

exp2 = Fold[SubsetMap[Reverse, #1, #2] &,
Append[#, 2] &

which gives

{10., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 1., 2}

Final comment: It is interesting to compare the time needed in each case.

exp1 = ArrayPad[list, pad, "Periodic"] // RepeatedTiming

{2.*10^-6, {10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2}}

while on the other hand

exp2 = Fold[SubsetMap[Reverse, #1, #2] &,
• Thanks, but I'm looking for a layer in the sense that I need an object that can be used within a larger neural network (created, with NetGraph, NetChain, etc). My current best is:  PeriodicPaddingLayer[n_Integer, m_Integer] := NetGraph[ { "left" -> PartLayer[;; m], "right" -> PartLayer[-n ;;], "catenate" -> CatenateLayer[] }, { NetPort@"Input" -> {"left", "right"}, {"right", NetPort@"Input", "left"} -> "catenate" } ]  which on my system works slightly faster than your version (though GPU compatibility is the real plus here). Commented May 31, 2021 at 14:37