Change:
static struct PyGetSetDef conv_forward_properties[] = { THP_FUNCTION_DEFAULT_PROPERTIES, {(char*)"stride", (getter)getTupleAttr<ConvForward, std::vector<int>, ConvParams, <del> &ConvParams::stride, int64_t, PyInt_FromLong>, NULL, NULL, NULL}, </del> <ins> &ConvParams::stride, int64_t, PortablePyInt_FromLong>, NULL, NULL, NULL}, </ins> {(char*)"padding", (getter)getTupleAttr<ConvForward, std::vector<int>, ConvParams, <del> &ConvParams::padding, int64_t, PyInt_FromLong>, NULL, NULL, NULL}, </del> <ins> &ConvParams::padding, int64_t, PortablePyInt_FromLong>, NULL, NULL, NULL}, </ins> {(char*)"dilation", (getter)getTupleAttr<ConvForward, std::vector<int>, ConvParams, <del> &ConvParams::dilation, int64_t, PyInt_FromLong>, NULL, NULL, NULL}, </del> <ins> &ConvParams::dilation, int64_t, PortablePyInt_FromLong>, NULL, NULL, NULL}, </ins> {(char*)"transposed", (getter)getValueAttr<ConvForward, bool, ConvParams, &ConvParams::transposed, long, PyBool_FromLong>, NULL, NULL, NULL}, {(char*)"output_padding", (getter)getTupleAttr<ConvForward, std::vector<int>, ConvParams, <del> &ConvParams::output_padding, int64_t, PyInt_FromLong>, NULL, NULL, NULL}, </del> <ins> &ConvParams::output_padding, int64_t, PortablePyInt_FromLong>, NULL, NULL, NULL}, </ins> {(char*)"groups", (getter)getValueAttr<ConvForward, int, ConvParams, <del> &ConvParams::groups, int64_t, PyInt_FromLong>, NULL, NULL, NULL}, </del> <ins> &ConvParams::groups, int64_t, PortablePyInt_FromLong>, NULL, NULL, NULL}, </ins> {NULL} }; static struct PyGetSetDef conv_backward_properties[] = { THP_FUNCTION_DEFAULT_PROPERTIES, {(char*)"stride", (getter)getTupleAttr<ConvBackward, std::vector<int>, ConvParams, <del> &ConvParams::stride, int64_t, PyInt_FromLong>, NULL, NULL, NULL}, </del> <ins> &ConvParams::stride, int64_t, PortablePyInt_FromLong>, NULL, NULL, NULL}, </ins> {(char*)"padding", (getter)getTupleAttr<ConvBackward, std::vector<int>, ConvParams, <del> &ConvParams::padding, int64_t, PyInt_FromLong>, NULL, NULL, NULL}, </del> <ins> &ConvParams::padding, int64_t, PortablePyInt_FromLong>, NULL, NULL, NULL}, </ins> {(char*)"dilation", (getter)getTupleAttr<ConvBackward, std::vector<int>, ConvParams, <del> &ConvParams::dilation, int64_t, PyInt_FromLong>, NULL, NULL, NULL}, </del> <ins> &ConvParams::dilation, int64_t, PortablePyInt_FromLong>, NULL, NULL, NULL}, </ins> {(char*)"transposed", (getter)getValueAttr<ConvBackward, bool, ConvParams, &ConvParams::transposed, long, PyBool_FromLong>, NULL, NULL, NULL}, {(char*)"output_padding", (getter)getTupleAttr<ConvBackward, std::vector<int>, ConvParams, <del> &ConvParams::output_padding, int64_t, PyInt_FromLong>, NULL, NULL, NULL}, </del> <ins> &ConvParams::output_padding, int64_t, PortablePyInt_FromLong>, NULL, NULL, NULL}, </ins> {(char*)"groups", (getter)getValueAttr<ConvBackward, int, ConvParams, <del> &ConvParams::groups, int64_t, PyInt_FromLong>, NULL, NULL, NULL}, </del> <ins> &ConvParams::groups, int64_t, PortablePyInt_FromLong>, NULL, NULL, NULL}, </ins> {NULL} }; static struct PyGetSetDef conv_backward_backward_properties[] = { THP_FUNCTION_DEFAULT_PROPERTIES, {(char*)"stride", (getter)getTupleAttr<ConvBackwardBackward, std::vector<int>, ConvParams, <del> &ConvParams::stride, int64_t, PyInt_FromLong>, NULL, NULL, NULL}, </del> <ins> &ConvParams::stride, int64_t, PortablePyInt_FromLong>, NULL, NULL, NULL}, </ins> {(char*)"padding", (getter)getTupleAttr<ConvBackwardBackward, std::vector<int>, ConvParams, <del> &ConvParams::padding, int64_t, PyInt_FromLong>, NULL, NULL, NULL}, </del> <ins> &ConvParams::padding, int64_t, PortablePyInt_FromLong>, NULL, NULL, NULL}, </ins> {(char*)"dilation", (getter)getTupleAttr<ConvBackwardBackward, std::vector<int>, ConvParams, <del> &ConvParams::dilation, int64_t, PyInt_FromLong>, NULL, NULL, NULL}, </del> <ins> &ConvParams::dilation, int64_t, PortablePyInt_FromLong>, NULL, NULL, NULL}, </ins> {(char*)"transposed", (getter)getValueAttr<ConvBackwardBackward, bool, ConvParams, &ConvParams::transposed, long, PyBool_FromLong>, NULL, NULL, NULL}, {(char*)"output_padding", (getter)getTupleAttr<ConvBackwardBackward, std::vector<int>, ConvParams, <del> &ConvParams::output_padding, int64_t, PyInt_FromLong>, NULL, NULL, NULL}, </del> <ins> &ConvParams::output_padding, int64_t, PortablePyInt_FromLong>, NULL, NULL, NULL}, </ins> {(char*)"groups", (getter)getValueAttr<ConvBackwardBackward, int, ConvParams, <del> &ConvParams::groups, int64_t, PyInt_FromLong>, NULL, NULL, NULL}, </del> <ins> &ConvParams::groups, int64_t, PortablePyInt_FromLong>, NULL, NULL, NULL}, </ins> {NULL} };

Discussion:
One representative error: The cause of the problem is : It seems that on clang, changing the type parameter here is sufficient to cause template instantiation to fail. Maybe the easiest way to fix this is to write a more portable version of PyIntFromLong (and friends) which always returns .