question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Do I need to pad?

See original GitHub issue

Excuse me for the noob question, I have sequences of different lengths and I use:

model = AutoregressiveWrapper(model, ignore_index=PAD_ID, pad_value=PAD_ID)

Do I need to pad as in this example or not?

def __getitem__(self, index):
        seq_tokens = self.examples[index]
        input_ids = torch.tensor(seq_tokens, dtype=torch.long)
        input_ids = F.pad(input_ids, (seq_len - len(input_ids), 0), value=self.pad_value)
        return input_ids

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
timsorarocommented, Apr 15, 2020

Haha, that would be awesome, thanks a lot!

EDIT: R.

0reactions
timsorarocommented, Apr 18, 2020

Great (:

Read more comments on GitHub >

github_iconTop Results From Across the Web

How Often Should You Change Your Pad? - Healthline
The American College of Obstetricians and Gynecologists (ACOG) recommends changing your pad at least every 4 to 8 hours, but that's just a ......
Read more >
Do I Have PAD? Take Our Self Assessment Quiz
Do I Have PAD? Take Our Self Assessment Quiz ... PAD: Peripheral Artery Disease: A build-up of plaque in the arteries reducing blood...
Read more >
Can I Wear the Same Pad All Day? (for Teens) - Kids Health
Changing your pad every 3 or 4 hours (more if your period is heavy) is good hygiene and helps prevent bad odors.
Read more >
Tampons Vs. Pads: Pros, Cons, and Which Is Better for You
Pads have the advantages of being easy to use and better for heavy periods, but you can't swim in them and they may...
Read more >
Can you wear pads all the time or only on your period? - Kotex
As long as you change them regularly, you can definitely wear pads all the time. I'm just not sure why you would want...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found