I am doing a similar example to this and I am having trouble defining the “baseline” variable. I tried
base_line=Variable(Variable(torch.ones(2), requires_grad=True))
base_line=base_line[0]

and get the error “RuntimeError: element 0 of tensors does not require grad and does not have a grad_fn”. I only have one baseline value, could you suggest a way to define this varieble?