From afbd3f7fb232a6d7e3029e3c98bf68fc792be2e5 Mon Sep 17 00:00:00 2001 From: Lorenzo Stella Date: Sun, 24 Mar 2024 15:26:18 +0100 Subject: [PATCH] avoid unnecessary padding --- src/chronos/chronos.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/chronos/chronos.py b/src/chronos/chronos.py index 2beb957..c9f50d0 100644 --- a/src/chronos/chronos.py +++ b/src/chronos/chronos.py @@ -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(