Commit 63d3cf6f authored by Mateusz Klimaszewski's avatar Mateusz Klimaszewski

Use default tensor constructor.

parent 000157b0
Pipeline #2882 passed with stage
in 3 minutes and 15 seconds
......@@ -56,7 +56,8 @@ class TokenCharactersIndexer(token_characters_indexer.TokenCharactersIndexer):
padded_tokens.pop()
# Truncates all the tokens to the desired length, and return the result.
return {
"token_characters": torch.LongTensor(
[list(token[:desired_token_length]) for token in padded_tokens]
"token_characters": torch.tensor(
[list(token[:desired_token_length]) for token in padded_tokens],
dtype=torch.long
)
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment