<h2 dir="auto"><g-emoji class="g-emoji" alias="bug" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f41b.png">🐛</g-emoji> Bug</h2>
<h2 dir="auto">To Reproduce</h2>
<p dir="auto">I have created a Python package with PyTorch and torchvision as dependencies:</p>
<p dir="auto">requirements.txt</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="# Image Preprocessing
pims_nd2&gt;=1.0,&lt;1.1
nd2reader&gt;=3.2.3,&lt;4.0.0
read-roi&gt;=1.6.0,&lt;2.0.0

scikit-image&gt;=0.17.2,&lt;1.0.0
opencv-python&lt;=4.2.0.30

numpy&gt;=1.18.5,&lt;2.0.0

# ML libraries
torch&gt;=1.6.0,&lt;2.0.0 
torchvision&gt;=0.7.0,&lt;1.0.0

# GUI
PyQt5&gt;=5.11.3,&lt;5.13.0

# Utils
tqdm"><pre class="notranslate"><code class="notranslate"># Image Preprocessing
pims_nd2&gt;=1.0,&lt;1.1
nd2reader&gt;=3.2.3,&lt;4.0.0
read-roi&gt;=1.6.0,&lt;2.0.0

scikit-image&gt;=0.17.2,&lt;1.0.0
opencv-python&lt;=4.2.0.30

numpy&gt;=1.18.5,&lt;2.0.0

# ML libraries
torch&gt;=1.6.0,&lt;2.0.0 
torchvision&gt;=0.7.0,&lt;1.0.0

# GUI
PyQt5&gt;=5.11.3,&lt;5.13.0

# Utils
tqdm
</code></pre></div>
<p dir="auto">setup.py</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open

# Get the long description from the README file
with open('README.md', 'r', encoding='utf-8') as f:
    long_description = f.read()

def parse_requirements(filename):
    &quot;&quot;&quot; load requirements from a pip requirements file &quot;&quot;&quot;
    lineiter = (line.strip() for line in open(filename))
    return [line for line in lineiter if line and not line.startswith(&quot;#&quot;)]

install_reqs = parse_requirements(&quot;requirements.txt&quot;)

# Arguments marked as &quot;Required&quot; below must be included for upload to PyPI.
# Fields marked as &quot;Optional&quot; may be commented out.

setup(
 ********************************
    install_requires=install_reqs,  # Optional

    include_package_data=True,
    data_files=[
        (&quot;&quot;,&quot;requirements.txt&quot;)
    ]
)"><pre class="notranslate"><code class="notranslate"># Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open

# Get the long description from the README file
with open('README.md', 'r', encoding='utf-8') as f:
    long_description = f.read()

def parse_requirements(filename):
    """ load requirements from a pip requirements file """
    lineiter = (line.strip() for line in open(filename))
    return [line for line in lineiter if line and not line.startswith("#")]

install_reqs = parse_requirements("requirements.txt")

# Arguments marked as "Required" below must be included for upload to PyPI.
# Fields marked as "Optional" may be commented out.

setup(
 ********************************
    install_requires=install_reqs,  # Optional

    include_package_data=True,
    data_files=[
        ("","requirements.txt")
    ]
)
</code></pre></div>
<p dir="auto">The problem is that when I install my package on Windows no PyTorch and torchvision gets downloaded. In Linux it works perfectly.</p>
<h2 dir="auto">Expected behavior</h2>
<p dir="auto">It should work as in Linux done</p>
<p dir="auto">cc <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/peterjc123/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/peterjc123">@peterjc123</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/maxluk/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/maxluk">@maxluk</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/nbcsm/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/nbcsm">@nbcsm</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/guyang3532/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/guyang3532">@guyang3532</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/gunandrose4u/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/gunandrose4u">@gunandrose4u</a> @smartcat2010 <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/mszhanyi/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/mszhanyi">@mszhanyi</a></p>
<h2 dir="auto"><g-emoji class="g-emoji" alias="bug" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f41b.png">🐛</g-emoji> Bug</h2>
<p dir="auto">While installing from source on windows, build fails with the error</p>
<h2 dir="auto">To Reproduce</h2>
<p dir="auto">Steps to reproduce the behavior:<br>
Install pytorch from source as per below steps.</p>
<p dir="auto">cd  ~\Desktop<br>
git clone --recursive <a href="https://github.com/pytorch/pytorch">https://github.com/pytorch/pytorch</a><br>
cd  ~\Desktop\pytorch<br>
set "VS150COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build"<br>
set CMAKE_GENERATOR=Visual Studio 15 2017 Win64<br>
set DISTUTILS_USE_SDK=1<br>
set "PREBUILD_COMMAND=%VS140COMNTOOLS%....\VC\vcvarsall.bat"<br>
set PREBUILD_COMMAND_ARGS=x64</p>
<p dir="auto">call "%VS150COMNTOOLS%\vcvarsall.bat" x64 -vcvars_ver=14.11<br>
python setup.py install</p>
<p dir="auto">Error message as below.<br>
"C:\Users&lt;username&gt;\Desktop\pytorch\build\INSTALL.vcxproj" (default target) (1) -&gt;<br>
"C:\Users&lt;username&gt;\Desktop\pytorch\build\ALL_BUILD.vcxproj" (default target) (3) -&gt;<br>
"C:\Users&lt;username&gt;\Desktop\pytorch\build\caffe2\AlgorithmsTest.vcxproj" (default target) (4) -&gt;<br>
"C:\Users&lt;username&gt;\Desktop\pytorch\build\caffe2\caffe2_gpu.vcxproj" (default target) (22) -&gt;<br>
(CustomBuild target) -&gt;<br>
c:\users&lt;username&gt;\desktop\pytorch\third_party\eigen\eigen\src/Core/arch/CUDA/Half.h(212): error : more than one instance of overloaded function "__hadd" matches the argument list: [C:\Users&lt;username&gt;\Desktop\pytorch<br>
\build\caffe2\caffe2_gpu.vcxproj]</p>
<h2 dir="auto">Expected behavior</h2>
<p dir="auto">Build to complete properly</p>
<h2 dir="auto">Environment</h2>
<p dir="auto">Windows</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Collecting environment information...
PyTorch version: 1.0.0a0+0f9807e
Is debug build: No
CUDA used to build PyTorch: 9.0

OS: Microsoft Windows 10 Pro
GCC version: (Rev5, Built by MSYS2 project) 5.3.0
CMake version: version 3.12.2

Python version: 3.6
Is CUDA available: Yes
CUDA runtime version: 9.0.176
GPU models and configuration: GPU 0: GeForce GTX 1080
Nvidia driver version: 397.93
cuDNN version: Probably one of the following:
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\bin\cudnn64_7.dll

Versions of relevant libraries:
[pip] Could not collect
[conda] cuda90                    1.0                           0    pytorch
[conda] pytorch                   0.4.1           py36_cuda90_cudnn7he774522_1    pytorch
[conda] torch                     1.0.0a0+0f9807e           &lt;pip&gt;
[conda] torchtext                 0.2.3                     &lt;pip&gt;
[conda] torchvision               0.2.0                     &lt;pip&gt;
[conda] torchvision-nightly       0.2.1                     &lt;pip&gt;"><pre class="notranslate"><code class="notranslate">Collecting environment information...
PyTorch version: 1.0.0a0+0f9807e
Is debug build: No
CUDA used to build PyTorch: 9.0

OS: Microsoft Windows 10 Pro
GCC version: (Rev5, Built by MSYS2 project) 5.3.0
CMake version: version 3.12.2

Python version: 3.6
Is CUDA available: Yes
CUDA runtime version: 9.0.176
GPU models and configuration: GPU 0: GeForce GTX 1080
Nvidia driver version: 397.93
cuDNN version: Probably one of the following:
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\bin\cudnn64_7.dll

Versions of relevant libraries:
[pip] Could not collect
[conda] cuda90                    1.0                           0    pytorch
[conda] pytorch                   0.4.1           py36_cuda90_cudnn7he774522_1    pytorch
[conda] torch                     1.0.0a0+0f9807e           &lt;pip&gt;
[conda] torchtext                 0.2.3                     &lt;pip&gt;
[conda] torchvision               0.2.0                     &lt;pip&gt;
[conda] torchvision-nightly       0.2.1                     &lt;pip&gt;
</code></pre></div>
<ul dir="auto">
<li>PyTorch Version (e.g., 1.0): 1.0</li>
<li>OS (e.g., Linux): Windows</li>
<li>How you installed PyTorch (<code class="notranslate">conda</code>, <code class="notranslate">pip</code>, source): source</li>
<li>Build command you used (if compiling from source): given above</li>
<li>Python version:3.6.6</li>
<li>CUDA/cuDNN version:9.0</li>
<li>GPU models and configuration:GTX 1080</li>
<li>Any other relevant information: N/A</li>
</ul>
<h2 dir="auto">Additional context</h2>
<p dir="auto">To fix the error and ensure that the compile is successful,  Modify the following lines in (where pytorch git source is cloned)<br>
~\Desktop\pytorch\third_party\eigen\Eigen\src\Core\arch\CUDA\Half.h</p>
<p dir="auto">EIGEN_STRONG_INLINE <strong>device</strong> half operator + (const half&amp; a, const half&amp; b) {<br>
return __hadd(::__half(a), ::__half(b));<br>
//  return __hadd(a, b);<br>
}<br>
EIGEN_STRONG_INLINE <strong>device</strong> half operator * (const half&amp; a, const half&amp; b) {<br>
return __hmul(a, b);<br>
}<br>
EIGEN_STRONG_INLINE <strong>device</strong> half operator - (const half&amp; a, const half&amp; b) {<br>
return __hsub(a, b);<br>
}<br>
EIGEN_STRONG_INLINE <strong>device</strong> half operator / (const half&amp; a, const half&amp; b) {<br>
return __hdiv(a, b);<br>
//  float num = __half2float(a);<br>
//  float denom = __half2float(b);<br>
//  return __float2half(num / denom);<br>
}</p>