我想請問一下如果我想要知道tensor(56, device='cuda:0')這個在以下這個Tensor所在的位置有什麼辦法可以做到呢?pytorch是否有相關套件可以達到此效果,謝謝
tensor([ 56, 83, 41, 29, 43, 112, 3, 86, 65, 96, 124, 84, 40, 25,
76, 4, 132, 12, 99, 78, 42, 63, 37, 144, 130, 13, 52, 57,
137, 116, 93, 67, 54, 46, 55, 38, 5, 16, 17, 19, 88, 69,
68, 39, 18, 85, 81, 32, 61, 147, 95, 74, 127, 14, 104, 64,
50, 94, 10, 59, 6, 7, 140, 131, 129, 87, 105, 28, 58, 119,
60, 73, 97, 107, 79, 120, 123, 118, 8, 9, 106, 62, 2, 102,
82, 75, 145, 70, 30, 121, 51, 66, 101, 136, 71, 44, 72, 110,
122, 92, 126, 77, 108, 0, 111, 24, 53, 114, 91, 31, 128, 139,
109, 49, 33, 113, 134, 135, 34, 45, 142, 143, 36, 89, 23, 115,
141, 138, 103, 125, 100, 20, 11, 21, 98, 35, 48, 146, 133, 22,
26, 90, 117, 148, 80, 47, 27, 15, 1], device='cuda:0')
有兩個方法: