(inputs, story_maxsents, story_maxlen)
| 140 | # append an array of zeros of size: |
| 141 | # (max_sentences - num sentences in story, max words in sentence) |
| 142 | def stack_inputs(inputs, story_maxsents, story_maxlen): |
| 143 | for i, story in enumerate(inputs): |
| 144 | inputs[i] = np.concatenate( |
| 145 | [ |
| 146 | story, |
| 147 | np.zeros((story_maxsents - story.shape[0], story_maxlen), 'int') |
| 148 | ] |
| 149 | ) |
| 150 | return np.stack(inputs) |
| 151 | |
| 152 | |
| 153 |