I’m not exactly sure how you would like to use these patches, as they can be used to apply a convolution via a matrix multiplication (unfold is also known as im2col which is used in the “matmul-conv” approach). Could you describe your use case a bit more and how the patches should be treated by the XceptionNet?
PS: you can post code snippets by wrapping them into three backticks ```, which makes debugging easier