Getting range of values from Pytorch Tensor

前端 未结 0 1589
耶瑟儿~
耶瑟儿~ 2020-12-18 05:52

I am trying to get a specific range of values from my pytorch tensor.

tensor=torch.tensor([0,1,2,3,4,5,6,7,8,9])
new_tensor=tensor[tensor>2]
print(new_tens         


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