We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rqvae/models/rqtransformer/primitives.py class LogitMask(nn.Module): def init(self, vocab_size: Iterable[int], value=-1e6): super().init()
self.vocab_size = vocab_size self.mask_cond = [vocab_size[0]]*len(vocab_size) != vocab_size self.value = value def forward(self, logits: Tensor) -> Tensor: if not self.mask_cond: return logits else: for idx, vocab_size in enumerate(self.vocab_size): logits[:, idx, vocab_size:].fill_(-float('Inf')) return logits
The logits mentioned in LogitMask should probably be expressed as logits[:, idx, vocab_size:] = logits[:, idx, vocab_size:].fill_(-float('Inf'))
The text was updated successfully, but these errors were encountered:
No branches or pull requests
rqvae/models/rqtransformer/primitives.py
class LogitMask(nn.Module):
def init(self, vocab_size: Iterable[int], value=-1e6):
super().init()
The logits mentioned in LogitMask should probably be expressed as logits[:, idx, vocab_size:] = logits[:, idx, vocab_size:].fill_(-float('Inf'))
The text was updated successfully, but these errors were encountered: