fastai / fastai_dev

fast.ai early development experiments
Apache License 2.0
638 stars 350 forks source link

Add parameter to pad_input to make it possible to specify which of the inputs should be padded #289

Closed tacchinotacchi closed 4 years ago

tacchinotacchi commented 4 years ago

I'm writing a seq2seq model, so I modified the pad_input function to pad both the input and target sequence by calling pad_input(datasource[slice], pad_fields=[0, 1]). Feel free to merge if you think it's useful :)

review-notebook-app[bot] commented 4 years ago

Check out this pull request on  ReviewNB

You'll be able to see Jupyter notebook diff and discuss changes. Powered by ReviewNB.

sgugger commented 4 years ago

Thanks. A few things can be refactored using L, I'll had that in a follow-up commit.