You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The default value of dilation (aka. non-dilated) is 0 in oneDNN while it's 1 in PyTorch. So DH = DW = 1 is used to create PyTorch max pooling operation, you may need to use DH = DW = 0 to create oneDNN pooling primitive.
The default value of dilation (aka. non-dilated) is 0 in oneDNN while it's 1 in PyTorch. So DH = DW = 1 is used to create PyTorch max pooling operation, you may need to use DH = DW = 0 to create oneDNN pooling primitive.
The problem is solved, and this method is correct. Thank you very much. If you hadn't told me, I might have been stuck researching this for who knows how long.
The example provided in the OneDNN examples (https://github.com/oneapi-src/oneDNN/blob/v3.6.2/examples/primitives/pooling.cpp) uses a formula that is inconsistent with the formula in PyTorch (https://pytorch.org/docs/stable/generated/torch.nn.MaxPool2d.html).
The formula in OneDNN:
The formula in PyTorch:
In my test case, I used the following parameters:
Using the OneDNN formula, I get OW = 55 and OH = 55.
Using the PyTorch formula, I get OW = 56 and OH = 56.
The resulting shapes are inconsistent!!!!
If I use the PyTorch formula to calculate OW and OH, and then generate the descriptor based on the OW and OH calculated from PyTorch, the program (https://github.com/oneapi-src/oneDNN/blob/v3.6.2/examples/primitives/pooling.cpp) will result in a compilation error!!!
I am even confused.
The text was updated successfully, but these errors were encountered: