(line)
| 233 | |
| 234 | # One-hot matrix of first to last letters (not including EOS) for input |
| 235 | def inputTensor(line): |
| 236 | tensor = torch.zeros(len(line), 1, n_letters) |
| 237 | for li in range(len(line)): |
| 238 | letter = line[li] |
| 239 | tensor[li][0][all_letters.find(letter)] = 1 |
| 240 | return tensor |
| 241 | |
| 242 | # ``LongTensor`` of second letter to end (EOS) for target |
| 243 | def targetTensor(line): |
no outgoing calls
no test coverage detected