<p dir="auto">Right now, VolumetricConvolution in THNN doesn't mark or handle bias=NULL cases</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>

<h2 dir="auto">To Reproduce</h2>
<p dir="auto">Steps to reproduce the behavior:</p>
<p dir="auto">Ensure <code class="notranslate">tqdm</code> is not installed in your environment, verify that <code class="notranslate">python -c 'import tqdm'</code> <strong>raises an exception.</strong></p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import torch
torch.hub.load('willprice/pytorch-hub-bug', 'entry_point')"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">torch</span>
<span class="pl-s1">torch</span>.<span class="pl-s1">hub</span>.<span class="pl-en">load</span>(<span class="pl-s">'willprice/pytorch-hub-bug'</span>, <span class="pl-s">'entry_point'</span>)</pre></div>
<p dir="auto">(<a href="https://github.com/willprice/pytorch-hub-bug">repo here</a>)<br>
This errors with</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Using cache found in /home/will/.cache/torch/hub/willprice_pytorch-hub-bug_master
Traceback (most recent call last):
  File &quot;&lt;string&gt;&quot;, line 1, in &lt;module&gt;
  File &quot;/usr/lib/python3.7/site-packages/torch/hub.py&quot;, line 336, in load
    hub_module = import_module(MODULE_HUBCONF, repo_dir + '/' + MODULE_HUBCONF)
  File &quot;/usr/lib/python3.7/site-packages/torch/hub.py&quot;, line 70, in import_module
    spec.loader.exec_module(module)
  File &quot;&lt;frozen importlib._bootstrap_external&gt;&quot;, line 728, in exec_module
  File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 219, in _call_with_frames_removed
  File &quot;/home/will/.cache/torch/hub/willprice_pytorch-hub-bug_master/hubconf.py&quot;, line 3, in &lt;module&gt;
    from entry import entry_point
  File &quot;/home/will/.cache/torch/hub/willprice_pytorch-hub-bug_master/entry.py&quot;, line 1, in &lt;module&gt;
    import tqdm
ModuleNotFoundError: No module named 'tqdm'"><pre class="notranslate"><code class="notranslate">Using cache found in /home/will/.cache/torch/hub/willprice_pytorch-hub-bug_master
Traceback (most recent call last):
  File "&lt;string&gt;", line 1, in &lt;module&gt;
  File "/usr/lib/python3.7/site-packages/torch/hub.py", line 336, in load
    hub_module = import_module(MODULE_HUBCONF, repo_dir + '/' + MODULE_HUBCONF)
  File "/usr/lib/python3.7/site-packages/torch/hub.py", line 70, in import_module
    spec.loader.exec_module(module)
  File "&lt;frozen importlib._bootstrap_external&gt;", line 728, in exec_module
  File "&lt;frozen importlib._bootstrap&gt;", line 219, in _call_with_frames_removed
  File "/home/will/.cache/torch/hub/willprice_pytorch-hub-bug_master/hubconf.py", line 3, in &lt;module&gt;
    from entry import entry_point
  File "/home/will/.cache/torch/hub/willprice_pytorch-hub-bug_master/entry.py", line 1, in &lt;module&gt;
    import tqdm
ModuleNotFoundError: No module named 'tqdm'
</code></pre></div>
<h2 dir="auto">Expected behavior</h2>
<p dir="auto">I'd expect <code class="notranslate">torch</code> to raise an exception saying a dependency isn't installed, rather than an <code class="notranslate">ImportError</code>.</p>
<p dir="auto">I would expect <code class="notranslate">torch.hub.load</code> to check <code class="notranslate">dependencies</code> in <code class="notranslate">hubconf.py</code> before executing <code class="notranslate">hubconf.py</code> and actually loading in the entrypoints. It's not clear from examples of <code class="notranslate">hubconf.py</code> that to avoid this behaviour you'd have to wrap all your entrypoints in functions that import the dependencies within the function body and not at the top level. This is a pain as it involves adding a wrapper for every entrypoint and duplicating all the docstrings.</p>
<h2 dir="auto">Suggested fix</h2>
<p dir="auto">Rather than evaluating the module, it'd make more sense to pull out the AST node corresponding to the <code class="notranslate">dependencies</code> variable and evaluate that only, perform the dependency check and only then import the full module. It might be that people have complicated <code class="notranslate">hubconf.py</code> files that prevent this from happening. In that case things get a bit more tricky and it might make sense to fallback on the current implementation as at least the user still gets ImportError exceptions that are <em>useful</em> if not the most user friendly.</p>
<h2 dir="auto">Environment</h2>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="PyTorch version: 1.1.0
Is debug build: No
CUDA used to build PyTorch: Could not collect

OS: Arch Linux
GCC version: (GCC) 9.1.0
CMake version: version 3.15.1

Python version: 3.7
Is CUDA available: No
CUDA runtime version: 10.1.168
GPU models and configuration: Could not collect
Nvidia driver version: Could not collect
cuDNN version: /usr/lib/libcudnn.so.7.6.1

Versions of relevant libraries:
[pip3] msgpack-numpy==0.4.3.2
[pip3] numpy==1.16.4
[pip3] pytorch-ignite==0.1.2
[pip3] torch==1.1.0
[pip3] torchaudio==0.2
[pip3] torchfile==0.1.0
[pip3] torchsummary==1.5.1
[pip3] torchvision==0.2.1
[pip3] torchviz==0.0.1
[conda] blas                      1.0                         mkl
[conda] mkl                       2019.4                      243
[conda] mkl_fft                   1.0.12           py36ha843d7b_0
[conda] mkl_random                1.0.2            py36hd81dba3_0
[conda] pytorch-cpu               1.1.0               py3.6_cpu_0    pytorch
[conda] torchvision-cpu           0.3.0             py36_cuNone_1    pytorch"><pre class="notranslate"><code class="notranslate">PyTorch version: 1.1.0
Is debug build: No
CUDA used to build PyTorch: Could not collect

OS: Arch Linux
GCC version: (GCC) 9.1.0
CMake version: version 3.15.1

Python version: 3.7
Is CUDA available: No
CUDA runtime version: 10.1.168
GPU models and configuration: Could not collect
Nvidia driver version: Could not collect
cuDNN version: /usr/lib/libcudnn.so.7.6.1

Versions of relevant libraries:
[pip3] msgpack-numpy==0.4.3.2
[pip3] numpy==1.16.4
[pip3] pytorch-ignite==0.1.2
[pip3] torch==1.1.0
[pip3] torchaudio==0.2
[pip3] torchfile==0.1.0
[pip3] torchsummary==1.5.1
[pip3] torchvision==0.2.1
[pip3] torchviz==0.0.1
[conda] blas                      1.0                         mkl
[conda] mkl                       2019.4                      243
[conda] mkl_fft                   1.0.12           py36ha843d7b_0
[conda] mkl_random                1.0.2            py36hd81dba3_0
[conda] pytorch-cpu               1.1.0               py3.6_cpu_0    pytorch
[conda] torchvision-cpu           0.3.0             py36_cuNone_1    pytorch
</code></pre></div>