So the first question, I was able to solve it. According to https://pytorch.org/cppdocs/api/typedef_namespacec10_1ae2c46d838a1de023ea17ade42f417669.html#exhale-typedef-namespacec10-1ae2c46d838a1de023ea17ade42f417669 3, IntArrayRef is declared under name space of c10. When I change it to ArrayRef<int64_t>, it seems work.