PetrochukM / PyTorch-NLP

Basic Utilities for PyTorch Natural Language Processing (NLP)
https://pytorchnlp.readthedocs.io
BSD 3-Clause "New" or "Revised" License
2.21k stars 258 forks source link

Replaced .view with .reshape on Attention #90

Closed jmribeiro closed 4 years ago

jmribeiro commented 4 years ago

Replaced .view with .reshape in Attention module in order to avoid RuntimeError: "view size is not compatible with input tensor's size and stride (at least one dimension spans across two contiguous subspaces). Use .reshape(...) instead.".

codecov-io commented 4 years ago

Codecov Report

Merging #90 into master will not change coverage. The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #90   +/-   ##
=======================================
  Coverage   94.41%   94.41%           
=======================================
  Files          63       63           
  Lines        1594     1594           
=======================================
  Hits         1505     1505           
  Misses         89       89
Impacted Files Coverage Δ
torchnlp/nn/attention.py 96.66% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 46406d3...ec82cf1. Read the comment docs.

PetrochukM commented 4 years ago

Sounds good. Thank you!