minerva-ml / steppy-toolkit

Curated set of transformers that make your work with steppy faster and more effective :telescope:
MIT License
22 stars 9 forks source link

pytorch Model breaks when outputs a single tensor #35

Open apyskir opened 5 years ago

apyskir commented 5 years ago

When model outputs a single tensor, this line gets len(outputs_batch) equal to first dimension of the tensor, but it should be 1. On the other hand if model outputs a list with one tensor: [x,], then this line gets outputs_batch as a list, but it expects this variable to be a tensor, so the code breaks. Please fix it, because it is impossible to work with such cases.

The same thing occurs when you try to validate your model here. Code expects outputs to be a tensor, and if it's a list, code breaks.