IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an email to s dot adaszewski at gmail dot com. User accounts are meant only to report issues and/or generate pull requests. This is a purpose-specific Git hosting for ADARED projects. Thank you for your understanding!
浏览代码

Protect against endless loop.

master
Stanislaw Adaszewski 4 年前
父节点
当前提交
2ff358f7ef
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. +5
    -0
      src/triacontagon/sampling.py

+ 5
- 0
src/triacontagon/sampling.py 查看文件

@@ -28,6 +28,11 @@ def fixed_unigram_candidate_sampler(
if len(num_repeats.shape) != 1:
raise ValueError('num_repeats must be 1D')
if torch.any(len(unigrams) - \
(true_classes >= 0).sum(dim=1) < \
num_repeats):
raise ValueError('Not enough classes to choose from')
num_rows = true_classes.shape[0]
print('true_classes.shape:', true_classes.shape)
# unigrams = np.array(unigrams)


正在加载...
取消
保存