The following code snippet gives the "tensor 'object is not callable" error.

I think it’s related to the “final_edge_index” tensor.
def forward(self, src, tgt, src_mask, tgt_mask,final_edge_index,batch):
“Take in and process masked src and target sequences.”
memory = self.encoder(self.src_embed(src), src_mask)
output = self.decoder(self.tgt_embed(tgt), memory, src_mask, tgt_mask,final_edge_index,batch)
return output
The value of this tensor is equal to:
image1002×165 12.8 KB

tensor([[[26., 15.],
[28., 19.]],
    [[28., 19.],
     [26., 15.]]], grad_fn=<PermuteBackward>)