If your forward() call in your function is labelled with @staticmethod it needs to be an new-style autograd function which takes a ctx as the first argument:
class RoundNoGradient(torch.autograd.Function):
    @staticmethod
    def forward(ctx, x):
        return x.round()
    @staticmethod
    def backward(ctx, g):
        return g 

then to call it:
input = torch.autograd.Variable(torch.randn(20, 16, 50, 10), requires_grad=True)
x = RoundNoGradient.apply(input)

However, you won’t be able to get x.grad because it’s an intermediate variable. You can access input.grad though:
print(input.grad)