SpatialConvolution.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:pytorch-dist 作者: apaszke 项目源码 文件源码
def __init__(self, nInputPlane, nOutputPlane, kW, kH, dW=1, dH=1, padW=0, padH=None):
        super(SpatialConvolution, self).__init__()

        self.nInputPlane = nInputPlane
        self.nOutputPlane = nOutputPlane
        self.kW = kW
        self.kH = kH

        self.dW = dW
        self.dH = dH
        self.padW = padW
        self.padH = padH or self.padW

        self.weight = torch.Tensor(nOutputPlane, nInputPlane, kH, kW)
        self.bias = torch.Tensor(nOutputPlane)
        self.gradWeight = torch.Tensor(nOutputPlane, nInputPlane, kH, kW)
        self.gradBias = torch.Tensor(nOutputPlane)

        self.reset()
        self._input = None
        self._gradOutput = None
        self.finput = None
        self.fgradInput = None
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号