for people who might want the answer I converted the string to it’s unicode and stored it in the tensor
here’s the answer
targets[i, :end] = torch.from_numpy(np.array(list(map(ord, cap[:end])))).to(torch.long)