MCPcopy Create free account
hub / github.com/pytorch/tutorials / tensorsFromPair

Function tensorsFromPair

intermediate_source/seq2seq_translation_tutorial.py:557–560  ·  view source on GitHub ↗
(pair)

Source from the content-addressed store, hash-verified

555 return torch.tensor(indexes, dtype=torch.long, device=device).view(1, -1)
556
557def tensorsFromPair(pair):
558 input_tensor = tensorFromSentence(input_lang, pair[0])
559 target_tensor = tensorFromSentence(output_lang, pair[1])
560 return (input_tensor, target_tensor)
561
562def get_dataloader(batch_size):
563 input_lang, output_lang, pairs = prepareData('eng', 'fra', True)

Callers

nothing calls this directly

Calls 1

tensorFromSentenceFunction · 0.85

Tested by

no test coverage detected