TensorRT-LLM icon indicating copy to clipboard operation
TensorRT-LLM copied to clipboard

How to convert functional.Tensor to numpy or a list of Tensor ?

Open lzcchl opened this issue 1 year ago • 1 comments

Due to upgrading the version of trtllm from 0.8.0 to 0.9.0, I originally obtained the "host_max_attention_window_sizes" as a List in models/generation_mixin.py, but now it is a Tensor, so in order to meet my original interface, I must convert the Tensor to a List or numpy, I can find the function about that, is there any function I can use ?

lzcchl avatar Apr 22 '24 12:04 lzcchl

In 0.8.0, although host_max_attention_window_sizes is a list, but the list still store the TensorRT-LLM tensors instead of numpy or torch tensor. How do you use these tensors at the time?

Also, as a input tensor in TensorRT-LLM, this means that we will pass inputs in generation.py by torch tensor, so you should be able find them in the generation.py (in python runtime).

byshiue avatar Apr 24 '24 02:04 byshiue