Repository: pytorch
Issue: ASSERT FAILED at /pytorch/torch/csrc/autograd/generated/VariableType_0.cpp:12721
Labels: triaged,module: assert failure

## 🐛 Bug
 
I am trying to run code for a TCAV score from Google Brain. I am using this code [here](https://github.com/MotJuMi/TCAV) for a PyTorch implementation. I am running into the following error which suggests I report the bug.  This is all being done on Google Colab as well. 

This is the error contained in the actual TCAV code

```
W0624 22:30:33.434192 140182358902656 deprecation_wrapper.py:119] From /content/tcav.py:330: The name tf.logging.info is deprecated. Please use tf.compat.v1.logging.info instead.

W0624 22:30:40.640806 140182358902656 lazy_loader.py:50] 
The TensorFlow contrib module will not be included in TensorFlow 2.0.
For more information, please see:
  * https://github.com/tensorflow/community/blob/master/rfcs/20180907-contrib-sunset.md
  * https://github.com/tensorflow/addons
  * https://github.com/tensorflow/io (for I/O related ops)
If you depend on functionality not listed there, please file an issue.

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-20-48f4c99b8232> in <module>()
     11                    num_random_exp=num_random_exp)
     12 
---> 13 results = mytcav.run()

17 frames
/content/tcav.py in run(self, num_workers, run_parallel)
    179             for i, param in enumerate(self.params):
    180                 tf.logging.info('Running param %s of %s' % (i, len(self.params)))
--> 181                 results.append(self._run_single_set(param))
    182         tf.logging.info('Done running %s params. Took %s seconds...' % (len(
    183             self.params), time.time() - now))

/content/tcav.py in _run_single_set(self, param)
    226         i_up = self.compute_tcav_score(
    227             mymodel, target_class_for_compute_tcav_score, cav_concept,
--> 228             cav_instance, acts[target_class][cav_instance.bottleneck])
    229         val_directional_dirs = self.get_directional_dir(
    230             mymodel, target_class_for_compute_tcav_score, cav_concept,

/content/tcav.py in compute_tcav_score(mymodel, target_class, concept, cav, class_acts, run_parallel, num_workers)
     75                                                         concept,
     76                                                         class_id),
---> 77                 class_acts)
     78             return sum(directions) / float(len(class_acts))
     79         else:

/usr/lib/python3.6/multiprocessing/pool.py in map(self, func, iterable, chunksize)
    264         in a list that is returned.
    265         '''
--> 266         return self._map_async(func, iterable, mapstar, chunksize).get()
    267 
    268     def starmap(self, func, iterable, chunksize=None):

/usr/lib/python3.6/multiprocessing/pool.py in get(self, timeout)
    642             return self._value
    643         else:
--> 644             raise self._value
    645 
    646     def _set(self, i, obj):

/usr/lib/python3.6/multiprocessing/pool.py in worker(inqueue, outqueue, initializer, initargs, maxtasks, wrap_exception)
    117         job, i, func, args, kwds = task
    118         try:
--> 119             result = (True, func(*args, **kwds))
    120         except Exception as e:
    121             if wrap_exception and func is not _helper_reraises_exception:

/usr/lib/python3.6/multiprocessing/pool.py in mapstar(args)
     42 
     43 def mapstar(args):
---> 44     return list(map(*args))
     45 
     46 def starmapstar(args):

/content/tcav.py in <lambda>(act)
     74                                                         cav,
     75                                                         concept,
---> 76                                                         class_id),
     77                 class_acts)
     78             return sum(directions) / float(len(class_acts))

/content/tcav.py in get_direction_dir_sign(mymodel, act, cav, concept, class_id)
     38         """
     39         # Grad points in the direction which DECREASES probability of class
---> 40         grad = np.reshape(mymodel.get_gradient(act, [class_id], cav.bottleneck), -1)
     41         dot_prod = np.dot(grad, cav.get_direction(concept))
     42         return dot_prod < 0

/content/model.py in get_gradient(self, acts, y, bottleneck_name)
     31         cutted_model = self.get_cutted_model(bottleneck_name).to(device)
     32         cutted_model.eval()
---> 33         outputs = cutted_model(inputs)
     34 
     35         # y=[i]

/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py in __call__(self, *input, **kwargs)
    491             result = self._slow_forward(*input, **kwargs)
    492         else:
--> 493             result = self.forward(*input, **kwargs)
    494         for hook in self._forward_hooks.values():
    495             hook_result = hook(self, input, result)

/content/model.py in forward(self, x)
    131                 y = y.view(y.size(0), -1)
    132 
--> 133             y = self.layers[i](y)
    134         return y
    135 

/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py in __call__(self, *input, **kwargs)
    491             result = self._slow_forward(*input, **kwargs)
    492         else:
--> 493             result = self.forward(*input, **kwargs)
    494         for hook in self._forward_hooks.values():
    495             hook_result = hook(self, input, result)

/usr/local/lib/python3.6/dist-packages/torchvision/models/inception.py in forward(self, x)
    195 
    196     def forward(self, x):
--> 197         branch3x3 = self.branch3x3(x)
    198 
    199         branch3x3dbl = self.branch3x3dbl_1(x)

/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py in __call__(self, *input, **kwargs)
    491             result = self._slow_forward(*input, **kwargs)
    492         else:
--> 493             result = self.forward(*input, **kwargs)
    494         for hook in self._forward_hooks.values():
    495             hook_result = hook(self, input, result)

/usr/local/lib/python3.6/dist-packages/torchvision/models/inception.py in forward(self, x)
    350 
    351     def forward(self, x):
--> 352         x = self.conv(x)
    353         x = self.bn(x)
    354         return F.relu(x, inplace=True)

/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py in __call__(self, *input, **kwargs)
    491             result = self._slow_forward(*input, **kwargs)
    492         else:
--> 493             result = self.forward(*input, **kwargs)
    494         for hook in self._forward_hooks.values():
    495             hook_result = hook(self, input, result)

/usr/local/lib/python3.6/dist-packages/torch/nn/modules/conv.py in forward(self, input)
    336                             _pair(0), self.dilation, self.groups)
    337         return F.conv2d(input, self.weight, self.bias, self.stride,
--> 338                         self.padding, self.dilation, self.groups)
    339 
    340 

RuntimeError: weight__impl_saved == weight_.getIntrusivePtr() ASSERT FAILED at /pytorch/torch/csrc/autograd/generated/VariableType_0.cpp:12721, please report a bug to PyTorch.
SEARCH STACK OVERFLOW
```

Is this an issue with PyTorch or am is the code I am using creating the issue? 

Thank you very much! 

**Updated Info**

PyTorch Version: 1.0.1
I am working in Google Colab w/ Python 3.6.

Because I am working in Google Colab it does not seem like it is possible for me to get a GDB backtrace but this is just based on my Google search.