def check_unused()

in diffq/diffq.py [0:0]


    def check_unused(self):
        for qparam in self._qparams:
            if qparam.other is not None:
                continue
            grad = qparam.param.grad
            if grad is None or (grad == 0).all():
                if qparam.logit.grad is not None:
                    qparam.logit.grad.data.zero_()