Solved by ptrblck in post #3 
              
              
                This is not a bug and expected behavior. As the error message explains, only floating point types (and complex types, which are also using floating point types internally) can require gradients.