Skip to content

How to transfer a Tensor type object to torch.Tensor #363

@ehuaa

Description

@ehuaa

I'm working on deploy huggingface roberta model to TensorRT-LLM, which has a little tweak from Bert with the embeddings.
In RobertaEmbedding the position_ids is calculated as follows:
image
image
I need to transfer input_ids to torch.Tensor to implement this function above, can you tell me the api to achieve this or how can i write code decently to implement this function, thanks!

Metadata

Metadata

Assignees

Labels

questionFurther information is requestedtriagedIssue has been triaged by maintainers

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions