Ok what repository are you using for the xlnet model? The error means that for some reason either input ids or attention masks should have two different things in it and you are only passing one tensor for each.