Cannot unsqueeze empty tensor #2660
Comments
Here's a repro:
|
I think this bug is due to there not be any non-empty lists in your batch. If there were, the aggregated padding would prevent this bug. I have a speculative fix in #2697, but I'm really not sure if it's the right approach. |
Hi @ksurya - could you let us know a bit more about how you are using the |
Hi guys, appreciate your interest on this issue. I will get back with a Jupyter Notebook reproducing this problem and let you know. |
- There appears to be an edge case in our handling of empty ListFields such that we fail to tensorize a batch of entirely empty ones. - Proposed solution: Make `TextField` always return a minimum padding size of 1. - Fixes #2660
- There appears to be an edge case in our handling of empty ListFields such that we fail to tensorize a batch of entirely empty ones. - Proposed solution: Make `TextField` always return a minimum padding size of 1. - Fixes allenai#2660
- There appears to be an edge case in our handling of empty ListFields such that we fail to tensorize a batch of entirely empty ones. - Proposed solution: Make `TextField` always return a minimum padding size of 1. - Fixes allenai#2660
System (please complete the following information):
Question
How can I have empty
fields.ListField
?I am having
fields.ListField([ text_field.empty_field() ])
as suggested in #1391but Torch raises
cannot unsqueeze empty tensor
on executinginstance.as_tensor_dict()
oriterator(..)
The text was updated successfully, but these errors were encountered: