Solved by JuanFMontesinos in post #6 
              
              
                Soo here it comes 
import torch

tensor_in = torch.rand(1, 1, 6, 6, 6)
kernel = torch.zeros(1, 1, 3, 3, 3)  # 3x3x3 kernel
# kernel shape out_channels,in_channels, t,h,w
# Identity kernel

kernel[:, :, 1, 1, 1] = 1

tensor_out = torch.nn.functional.conv3d(tensor_in, kernel, padding=1)

print((tensor…