Loading dictionaries with DataLoader

Hi guys,

I’m using pytorch to train Tree-LSTMs. In order to reduce the bottleneck in data loading on GPUs, I’m trying to use the DataLoader which takes as input a custom Dataset class from this tutorial. My “Tree” data structure is implemented recursively as
{parent:[children]}
with parent being a torch.Tensor and children being a list of torch.Tensor if the node is childless or a data structure of similar format if the node has children itself. As an example

{Tensor : 
    [{Tensor : 
        [Tensor, Tensor]},
    Tensor]}

When loading manually the data points one by one, I do manage to train my model. When I try to load the data via the DataLoader, however, I get a KeyError:parent_tensor when iterating through the generator.

any idea on how to solve that ?

Thanks !