For a custom layer like that:

class CustomLayer(Function):
    @staticmethod
    def forward(ctx, input, int1, int2):
        ctx.save_for_backward(input, int1, int2)
        out = some_c_function(input, int1, int2)
        return out

    @staticmethod
    def backward(ctx, grad_output):
        input, int1, int2 = ctx.saved_tensors
        grad_input = torch.zeros_like(input)
        backward_func(input, grad_output, grad_input, int1, int2)
        return grad_input, None, None



But when I call this layer, error occurred:
TypeError: save_for_backward can only save variables, but argument 3 is of type int

Now the question is, how can I save those integers for backward ?