MCPcopy Create free account
hub / github.com/NVIDIA/TensorRT-LLM / _prepare_input_ids

Function _prepare_input_ids

tensorrt_llm/runtime/generation.py:124–131  ·  view source on GitHub ↗
(tensors: Sequence[torch.Tensor])

Source from the content-addressed store, hash-verified

122
123
124def _prepare_input_ids(tensors: Sequence[torch.Tensor]):
125 tensors = [torch.flatten(t) for t in tensors]
126 data = torch.concat(tensors)
127 row_lengths = [t.size(0) for t in tensors]
128 row_lengths = torch.tensor(row_lengths,
129 dtype=torch.int32,
130 device=data.device)
131 return (data, row_lengths)
132
133
134def CUASSERT(cuda_ret):

Callers 1

decode_batchMethod · 0.85

Calls 2

flattenMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected