Hi AlbanD
Both of them  (value_path, value_body) are a coming from the raw data, there is not a graph calculation.
Anyway I just modify the initial definition.
value_body = torch.zeros((batch, 1, size_body, size_emb_body), device = ‘cuda’, requires_grad=False)
value_path = torch.zeros((batch, 1, size_path, size_emb_path), device = ‘cuda’,requires_grad=False)
And I still need to define “error.backward(retain_graph=True)” if not, the ERROR shows up.