How to map element in pytorch tensor to id?

后端 未结 0 1671
一向
一向 2021-01-04 23:04

Given a tensor:

A = torch.tensor([2., 3., 4., 5., 6., 7.])

Then, give each element in A an id:

id = torch.arange(         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题