What is the difference among padding_mode 'reflect', 'replicate' and 'circular'?

Hi, I’m using nn.Conv1d to handle sequential data, and want to use mirror padding not to focus out the boundary.

I found that in PyTorch, there are three types of padding except 'zeros', 'reflect', 'replicate', 'circular' and what’s the different among them? I searched the docs, comments of source code, but there isn’t any comment about the difference.

Thanks!

1 Like