Solved by tom in post #2 
              
              
                You need to match the scalar type to the tensor’s scalar_type, so: 
If you instantiated a torch::kLong tensor (that’s 64 bit integers), use int64_t. For kInt (32 bit) use int32_t, for nothing (aka kFloat), float. 
Note that you usually do not need packed_accessor for CPU tensors, they are intended f…