To work out tokenization_utils_base.py:731 list to tensor so slow
tokenization_utils_base.py:731: UserWarning: Creating a tensor from a list of numpy.ndarrays is extremely slow. Please consider converting the list to a single numpy.ndarray with numpy.asarray() before converting to a tensor. (Triggered internally at ../torch/csrc/utils/tensor_new.cpp:230.)
Solved this problem to accelerate  list to tensor.
@askxiaozhang Thanks for opening this PR and contributing to improving the transformers library! There is another PR opened #24772 which addresses this, and so this PR will not be merged in. 