def forward(self, x):

    def _inner_forward(x):
        if self.use_res_connect:
            return (x + self.conv(x))
        else:
            return self.conv(x)
    if (self.with_cp and x.requires_grad):
        out = cp.checkpoint(_inner_forward, x)
    else:
        out = _inner_forward(x)
    return out
def forward(self, x):

    def _inner_forward(x):
        if self.use_res_connect:
            return (x + self.conv(x))
        else:
            return self.conv(x)
    if (self.with_cp and x.requires_grad):
        out = cp.checkpoint(_inner_forward, x)
    else:
        out = _inner_forward(x)
    return out