Open wohuainiande opened 4 months ago
大佬 问一下这个函数报错 是啥情况 跟设备有关系吗 还是不兼容之类的 该如何修改啊 binary_encoded_array[i, number - 1] = 1.0 # Adjust index for 0-based indexing IndexError: tensors used as indices must be long, int, byte or bool tensors
你好,我也是出现这个问题,请问您解决了这个问题了么,在等待
number是tensor类型的变量,转成int类型就可以了。 number = int(input_array[i, j].item()) @wohuainiande @989888
大佬 问一下这个函数报错 是啥情况 跟设备有关系吗 还是不兼容之类的 该如何修改啊 binary_encoded_array[i, number - 1] = 1.0 # Adjust index for 0-based indexing IndexError: tensors used as indices must be long, int, byte or bool tensors