When I change a vecator into one-hot representation with " torch.zeros((len(state), 3)).scatter_(1, state, 1)", I got the following error:
{RuntimeError}Expected object of scalar type Long but got scalar type Char for argument #3 'index'

Type information of state is given as follow:
tensor([1, 2], dtype=torch.int8)

From the document, I guess we could use Int8 Tensor as index. But, why did I get this error?