Pytorch to caffe conversion

Code exists to automatically convert a pytorch model to a caffe file:

pytorch2caffe.py

However, this part doesn’t seem to work any longer in verson 0.3.0:

    elif parent_type == 'MaxPool2dBackward':
        pooling_param = OrderedDict()
        pooling_param['pool'] = 'MAX'
        pooling_param['kernel_size'] = func.kernel_size[0]
        pooling_param['stride'] = func.stride[0]
        padding = func.padding[0]
        pooling_param['pad'] = padding
        layer['pooling_param'] = pooling_param
    elif parent_type == 'AvgPool2dBackward':
        pooling_param = OrderedDict()
        pooling_param['pool'] = 'AVE'
        pooling_param['kernel_size'] = func.kernel_size[0]
        pooling_param['stride'] = func.stride[0]
        pooling_param['pad'] = func.padding[0]
        layer['pooling_param'] = pooling_param

Because the backward functions for pooling no longer have the attributes, stride, padding, and padding.

This is unfortunate, since otherwise, this is a very convenient and general way to convert, and to determine the computational graph for automatic model conversion. In fact we would like to use this same method to automatically convert a pytorch model to another one, with new layer types.

Is there any way to access these parameters in this code? If not, can the parameters be reconstructed somehow? (How can the backward function do without them?)

I have looked online and see that previous responses told people to revert to 0.2.0, but this is not an option that is futureproof.

Thanks in advance,

Jeff