Which line of code raises the first error? Could you check the type of the object?
Unrelated to this error, but it seems all operations are performed on the CPU, so I’m not sure why you are pushing the parameters to the GPU. Could you explain your use case a bit?