jiebi/CodeConvo huggingface dataset:
Change:
>>> m = nn.Dropout(p=0.2) >>> input = autograd.Variable(torch.randn(20, 16)) >>> output = m(input) <ins> .. _Improving neural networks by preventing co-adaptation of feature detectors: https://arxiv.org/abs/1207.0580 </ins> """ def __init__(self, p=0.5, inplace=False):

Discussion:
"Randomly zeroes some of the elements of the input tensor. The elements to zero are randomized on every forward call." This is incorrect; the function also scales up by 1/(1-p), which the implementation correctly does.
Change:
torch.Size([3, 2, 2, 1]) >>> torch.unflatten(torch.randn(3, 4, 1), 1, (-1, 2)).shape torch.Size([3, 2, 2, 1]) <del> >>> torch.unflatten(torch.randn(5, 12, 3), -1, (2, 2, 3, 1, 1)).shape </del> <ins> >>> torch.unflatten(torch.randn(5, 12, 3), -2, (2, 2, 3, 1, 1)).shape </ins> torch.Size([5, 2, 2, 3, 1, 1, 3]) """.format( **common_args

Discussion:
Link In the third example the doc shows torch.unflatten((5, 12, 3), -1, (2, 2, 3, 1, 1)).shape torch.Size([5, 2, 2, 3, 1, 1, 3]) which should be incorrect, the correct code should be torch.unflatten((5, 12, 3), -2, (2, 2, 3, 1, 1)).shape torch.Size([5, 2, 2, 3, 1, 1, 3]) No response cc
Thank you for reporting. Next time you spot a problem like that please do not hesitate to propose a PR with the fix.
Change:
from torch.autograd import Variable <ins> def get_a_var(obj): if isinstance(obj, Variable): return obj if isinstance(obj, list) or isinstance(obj, tuple): results = map(get_a_var, obj) for result in results: if isinstance(result, Variable): return result if isinstance(obj, dict): results = map(get_a_var, obj.items()) for result in results: if isinstance(result, Variable): return result return None </ins> def parallel_apply(modules, inputs, kwargs_tup=None): assert len(modules) == len(inputs) if kwargs_tup:

Discussion:
is the culprit. Assumes that the first input is a variable or a sequence containing a variable in index 0 (recursively indexed). Workaround is to pass a dummy variable as first input, as suggested in
Could you provide a short reproducer for testing? Think this shouldn't be too hard to fix.
Sure, here's a gist along with commands/outputs:
fixed in master via
Change:
scale = 1 exp_max = int(exp_max) <ins> prec = PRINT_OPTS.precision </ins> if int_mode: <del> if exp_max > 9: format = '{:11.4e}' sz = max(min_sz, 11) </del> <ins> if exp_max > prec + 1: format = '{{:11.{}e}}'.format(prec) sz = max(min_sz, 7 + prec) </ins> else: sz = max(min_sz, exp_max + 1) format = '{:' + str(sz) + '.0f}' else: <del> if exp_max - exp_min > 4: sz = 11 </del> <ins> if exp_max - exp_min > prec: sz = 7 + prec </ins> if abs(exp_max) > 99 or abs(exp_min) > 99: sz = sz + 1 sz = max(min_sz, sz) <del> format = '{:' + str(sz) + '.4e}' </del> <ins> format = '{{:{}.{}e}}'.format(sz, prec) </ins> else: <del> if exp_max > 5 or exp_max < 0: </del> <ins> if exp_max > prec + 1 or exp_max < 0: </ins> sz = max(min_sz, 7) scale = math.pow(10, exp_max-1) else:

Discussion:
It seems that the following link that can be reached from here (check the screenshot) is broken: Page: Broken link: Screenshot: ! cc
this should be transferred to , but I don't have permissions to do that. Fix is available at pytorch/hub.
Change:
for (int idx = 0; idx < size; idx++) { PyObject* obj = tuple ? PyTuple_GET_ITEM(arg, idx) : PyList_GET_ITEM(arg, idx); if (!THPVariable_Check(obj)) { <del> throw TypeError("expected Variable as element %d in argument %d, but got %s", </del> <ins> throw TypeError("expected Tensor as element %d in argument %d, but got %s", </ins> idx, i, Py_TYPE(args[i])->tp_name); } res[idx] = reinterpret_cast<THPVariable*>(obj)->cdata;

Discussion:
Considering the merge of and , and the "removal" of from the API, there are still some messages that reference . This might prove to be confusing for new users starting off from , as they probably might not have heard of . I did a code search to find out multiple instances of this in . PyTorch or Caffe2: PyTorch How you installed PyTorch (conda, pip, source): source (@ ) Build command you used (if compiling from source): OS: Ubuntu 16.04.2 PyTorch version: Python version: 3.5 CUDA/cuDNN version: 8.0.44 GPU models and configuration: GeForce 940M GCC version (if compiling from source): 5.4.0 CMake version: 3.5.1
Change:
- bool training - double epsilon ]] <ins> [[ name: cudnn_version only_register: True ]] static PyObject * THCUDNN_cudnn_version(PyObject *self, PyObject *args) { return PyLong_FromLong(CUDNN_VERSION); } </ins>

Discussion:
We should check that the version from cudnn.h matches the version from the loaded shared library. Really weird things happen if they don't match.
Change:
{ transpose_m2 = (transpose_r == 'n' ? 't' : 'n'); m2_ = THTensor_(newContiguous)(m2); <ins> free_m2 = 1; </ins> } #pragma omp critical(blasgemm)

Discussion:
Here is an example of what seems to be a memory leak in pytorch, although it could be numpy? The leak was only occurring when using the or array unsqueezing methods in numpy. Also worth noting that the issue is resolved by removing the from and casting the torch tensor to type. An easy workaround is to reshape the array after turning it into a torch Tensor.
Change:
setattr(self, name, param) self._all_weights.append(param_names) <del> self._param_buf_size += sum(p.numel() for p in layer_params) </del> self.flatten_parameters() self.reset_parameters()

Discussion:
Since the new pytorch version, I have a warning when I that says: When I do as suggested, and then try to encode again, I get the following error though: Any idea?
do you have code the reproduces the issue?
What was the fix? I still see the error on Pytorch Version: 0.2.03 AttributeError: 'LSTM' object has no attribute 'parambufsize'
Change:
from copy import deepcopy from collections import OrderedDict from itertools import product <del> from operator import mul </del> <ins> from operator import mul, itemgetter </ins> from functools import reduce, wraps from torch.autograd.gradcheck import gradgradcheck, gradcheck from torch.autograd.function import once_differentiable

Discussion:
I am having problem in running the backward propagation with svd. In particular, it seems working when the first dimension of the matrix x (below) is greater than the second. But I get the following error if the first is smaller than the second. PyTorch version: 2018.04.20 Is debug build: No CUDA used to build PyTorch: 8.0.61 OS: Ubuntu 16.04.4 LTS GCC version: (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 CMake version: Could not collect Python version: 3.5 Is CUDA available: No CUDA runtime version: No CUDA GPU models and configuration: No CUDA Nvidia driver version: No CUDA cuDNN version: No CUDA Versions of relevant libraries: [pip3] numpy (1.13.3) [pip3] torch (2018.4.20) [pip3] torchvision (0.2.0) [conda] pytorch 0.3.1 py35cuda8.0.61cudnn7.0.52 pytorch [conda] pytorch-nightly 2018.04.20 py35cuda8.0.61cudnn7.1.21 pytorch [conda] torchvision 0.2.0 py35heaa392f_1 pytorch
Repro'ed on 0.4 branch. works btw.
What does "Repro'ed" means? Should I install from that branch? I need to compute the kernel of a matrix, therefore I need the last columns of the matrix V (which is why I have to pass ).
It's a shorthand for "reproduced", which means that the bug still hasn't been fixed. Sorry, we'll try to get to it soon.
Change:
output[index] = ScalarConvert<int, Dtype>::to(0); continue; } <ins> assert(cur_target  >= 0 && cur_target  < n_classes); </ins> Dtype weight = weights ? weights[cur_target] : ScalarConvert<int, Dtype>::to(1); output[index] = -weight * input[index][cur_target];

Discussion:
Claim: When I use an invalid label with F.crossentropy with reduce=False, I don't receive an error message. I do receive an error message when reduce=True. Code: Result: No error message received. Expected error message: Context: I was using , accidentally used an invalid label, and got extremely large losses and extremely small losses, and inconsistently so. Environment: OS: Ubuntu 16.04 on Docker and host PyTorch version: 0.3.0.post4 How you installed PyTorch: conda Python version: 3.6.3
Change:
Writes all values from the tensor :attr:`src` into :attr:`self` at the indices specified in the :attr:`index` tensor. For each value in :attr:`src`, its output <del> index is specified by its index in :attr:`src` for dimension != :attr:`dim` and by the corresponding value in :attr:`index` for dimension = :attr:`dim`. </del> <ins> index is specified by its index in :attr:`src` for ``dimension != dim`` and by the corresponding value in :attr:`index` for ``dimension = dim``. </ins> For a 3-D tensor, :attr:`self` is updated as::

Discussion:
is not available in the docs page, but the doc string has been in . This was mentioned earlier in

Oh, bilinear, I missed that last time I looked at it. I'll add a docstring.

returns nothing. Might be useful to have some linter in the build process to find Python functions missing

Pytorch 0.4.0 gives a segmentation fault with dilated 2D convolutions over a specific size. import torch import as nn model = nn.Conv2d(inchannels=64, outchannels=64, kernelsize=5, dilation=2) model(([1, 64, 1166, 1166])) # This runs model(([1, 64, 1167, 1167])) # This crashes PyTorch version: 0.4.0 Is debug build: No CUDA used to build PyTorch: 9.1.85 OS: CentOS Linux 7 (Core) GCC version: (GCC) 4.8.5 (Red Hat 4.8.5-28) CMake version: version 2.8.12.2 Python version: 3.6 Is CUDA available: Yes CUDA runtime version: 8.0.61 GPU models and configuration: GPU 0: GeForce GTX 1080 Ti GPU 1: TITAN X (Pascal) GPU 2: Quadro K2200 Nvidia driver version: 390.59 cuDNN version: Probably one of the following: /usr/local/cuda- /usr/local/cuda- /usr/local/cuda-7.5/lib64/libcudnnstatic.a /usr/local/cuda- /usr/local/cuda-8.0/lib64/libcudnn_static.a
do you think this is the same as the segfault you showed me a week ago on convolution?
ah yes. int overflow. I only fixed conv3d because I didn’t want to hurt perf. I’ll fix all of them.

This should be an easy one.. The function is implemented, just no sign of it in the docs.
Change:
Args: input (Tensor): the input 2-D tensor <del> some (bool, optional): controls the number of singular values to be computed </del> <ins> some (bool, optional): controls the shape of returned `U` and `V` </ins> out (tuple, optional): the output tuple of tensors Example::

Discussion:
The documentation of the parameter to is one of the strangest I've seen... what does (the default) do???
Ha it is somewhat weird indeed. When , the returned U and V matrices are square orthonormal matrices. I will send out a PR to clarify this.