函数签名
def index_select(input: Tensor, dim: _int, index: Tensor, *, out: Optional[Tensor]=None) -> Tensor: ...
报错信息
RuntimeError: "index_select_out_cuda_impl" not implemented for 'Float'
解决方案
可尝试给index参数加上.long(),如
torch.index_select(input_tensor, dim, index_tensor.long())