Just because doing taxes and accounting makes me want to have a little who knows the most evil autograd tricks competition with @albanD and @ptrblck, here is my  entry:
class DangerousDot(torch.autograd.Function):
    @staticmethod
    def forward(ctx, a, b):
        ctx._a = a
        ctx._b = b
        return a.dot(b)
    @staticmethod
    def backward(ctx, grad_out):
        return grad_out * ctx._b, grad_out * ctx._a


a = torch.randn(10, requires_grad=True, dtype=torch.double)
b = torch.randn(10, requires_grad=True, dtype=torch.double)
torch.autograd.gradcheck(DangerousDot.apply, (a, b))

a = torch.rand(1, requires_grad=True)
b = torch.rand(2, requires_grad=True)
c = torch.rand(3, requires_grad=True)
x = torch.rand(1, requires_grad=True)
y = torch.empty(4)
y[0] = x
y[1] = DangerousDot.apply(y[:1], a)
y[2] = DangerousDot.apply(y[:2], b)
y[3] = DangerousDot.apply(y[:3], c)
y.sum().backward()

Explanation: The bit that is responsible for the version check in autograd.Functions is ctx.save_for_backward(...) and ctx.saved_tensors. So avoiding that for a and b and assigning them to the ctx directly bypasses the checks.
Strictly don’t use this at home, it’s evil and dangerous!
Best regards
Thomas