Skip to content

Commit

Permalink
avoid unnecessary padding
Browse files Browse the repository at this point in the history
  • Loading branch information
lostella committed Mar 24, 2024
1 parent 73be250 commit afbd3f7
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions src/chronos/chronos.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,6 @@ def input_transform(

if length > self.config.context_length:
context = context[..., -self.config.context_length :]
elif length < self.config.context_length:
padding_size = (
*context.shape[:-1],
self.config.context_length - length,
)
padding = torch.full(size=padding_size, fill_value=torch.nan)
context = torch.concat((padding, context), dim=-1)

attention_mask = ~torch.isnan(context)
scale = torch.nansum(
Expand Down

0 comments on commit afbd3f7

Please sign in to comment.