Arif
Jul 2, 2021

--

Nice writing. But I in fact ran MaxPool3d on the example you illustrated, and got different result:

[7., 3.],

[9., 8.]],

[[3., 6.],

[4., 6.]]

Wondering where is my mistake. Here is my code:

import torch

from torch import nn

x = torch.tensor(

[

[

[3,2,1,3],

[0,7,3,3],

[3,9,3,4],

[2,3,8,3]

],

[

[0, 2, 1, 3],

[0, 4, 3, 2],

[3, 1, 3, 4],

[2, 6, 8, 1]

],

[

[3, 2, 1, 1],

[0, 3, 3, 3],

[3, 4, 3, 4],

[2, 3, 6, 3]

],

[

[3, 2, 1, 3],

[0, 3, 6, 3],

[0, 2, 3, 4],

[2, 3, 1, 3]

],

],

dtype=torch.float64

)

x = x.reshape(1,4,4,4)

print(x)

m = nn.MaxPool3d(kernel_size=(2,2,2))

y = m(x)

print(y)

--

--

Arif
Arif

No responses yet