@jinchen62 Did you fill the float as the template type? like this?
std::vector v(t.data_ptr(), t.data_ptr() + t.numel())
Can you paste the error message here? I did not try on my computer, but this should work.