The new data loader is now returning scalar inputs as a 1-D tensor instead of a 2-D so the torch.squeeze() op inside the model's forward method is no longer needed.
This torch.squeeze() op was also raising an issue at inference when we pass a sequence with one element only. In fact, by calling torch.squeeze() on all inputs we lose the information to separate between scalar features and list features with only one element. The new data loader is ensuring that list input with one element are kept as 2-D.
I removed the torch.squeeze() op and added a check for applying the model on input sequences with one element, at inference.
torch.squeeze()
op inside the model's forward method is no longer needed.torch.squeeze()
op was also raising an issue at inference when we pass a sequence with one element only. In fact, by callingtorch.squeeze()
on all inputs we lose the information to separate between scalar features and list features with only one element. The new data loader is ensuring that list input with one element are kept as 2-D.torch.squeeze()
op and added a check for applying the model on input sequences with one element, at inference.