Can you please suggest me the int values that I need to pass into the tensor.unfold for my problem. I am using the following github repository to extend my  KernelConv2d to  KernelConv3d.
  

      github.com
  

  
    gan3sh500/kervolution-pytorch/blob/master/layer.py


    import torch


class LinearKernel(torch.nn.Module):
    def __init__(self):
        super(LinearKernel, self).__init__()
    
    def forward(self, x_unf, w, b):
        t = x_unf.transpose(1, 2).matmul(w.view(w.size(0), -1).t()).transpose(1, 2)
        if b is not None:
            return t + b
        return t
        
        
class PolynomialKernel(LinearKernel):
    def __init__(self, cp=2.0, dp=3, train_cp=True):
        super(PolynomialKernel, self).__init__()
        self.cp = torch.nn.parameter.Parameter(torch.tensor(cp, requires_grad=train_cp))
        self.dp = dp




  This file has been truncated. show original