SPM_toolkit
SPM_toolkit copied to clipboard
cat(): argument 'tensors' (position 1) must be tuple of Tensors, not generator
https://github.com/lanwuwei/SPM_toolkit/blob/3e2cb35681e9f31bfcc66afde2159bbf394056df/DecAtt/main_quora.py#L56
cat(): argument 'tensors' (position 1) must be tuple of Tensors, not generator
can I fix this bug use this line?
torch.cat(tuple([dict[word].view(1, -1) for word in lsent]))
torch.cat([dict[word].view(1, -1) for word in lsent])
is this also ok ?
Hi caoxu, I tried your second answer in other code: https://github.com/lanwuwei/Subword-PWIM/blob/6e9ef11fa404c4ea6e350f8e75f7d1055869d8d9/model.py#L436 In my PyTorch version 0.4.0, both are OK. You can modify the code based on your version.
@lanwuwei Thanks for your help, I find my pytorch version is not 0.4.0.