I changed the first few line of backward function  to:
@staticmethod
def backward(ctx, grad_output):
input1,indices= ctx.saved_variables[0],ctx.indices
print(input1)
input=input1.clone()
But I am still running into the same error even though input1 is Variable now.