Where can find 'pad' or replace?


(Rui.Tan) #1

there is a functional pad in python. But I can not find it in Libtorch. Could someone help me?


(Beatrice Paige) #2

it’s simply put here: http://www.datasciencemadesimple.com/padding-ljustrjust-center-function-python/


(Alban D) #3

Hi,

The pad function is actually implemented in pure python for the functional package directly here. So it is not available from libtorch at the moment.
Note that the functions used in there though are implemented in libtorch. For example, constant padding can be done with constant_pad_nd().