sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: pytorch
Issue: Error "builtin cannot be used as a value" when add Python snippets in C++
Labels: oncall: jit,low priority,triaged

## 🐛 Bug

It looks like a great way to define methods in Python format from C++, for debugging and testing purpose. 
However, I realized that not all eager-mode definitions are accepted. 

## To Reproduce

As an example, if I add this snipped in my test, 

```
script::Module m("m");
m.define(R"JIT(
      def test_shape_prop(self, x):
          # type: (int) -> int
          if not bool(x):
              return x
          else:
              z = torch.zeros([2, 2], dtype=torch.int64)
          return int(z[0])
)JIT");

std::vector<IValue> inputs;
auto minput = 0.5 * torch::ones({});
inputs.emplace_back(minput);
auto ref = m.run_method("test_shape_prop", minput);
```

There's run-time error:

```
unknown file: Failure
C++ exception with description "
builtin cannot be used as a value:
  File "<string>", line 7
                return x
            else:
                z = torch.zeros([2, 2], dtype=torch.int64)
                                              ~~~~~~~~~~~ <--- HERE
            return int(z[0])
  
" thrown in the test body.

```

## Expected behavior

There should be no difference between the models/methods I could add in eager mode vs. adding them in C++. 

## Environment

PyTorch version: 1.4.0a0+59f180c
Is debug build: Yes
CUDA used to build PyTorch: None

OS: Mac OSX 10.14.6
GCC version: Could not collect
CMake version: version 3.14.0

Python version: 3.7
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:
[pip] numpy==1.16.4
[pip] numpydoc==0.9.1
[pip] torch==1.4.0a0+e3d5d46
[pip] torchvision==0.1.8
[conda] blas                      1.0                         mkl
[conda] mkl                       2019.4                      233
[conda] mkl-include               2019.4                      233
[conda] mkl-service               2.0.2            py37h1de35cc_0
[conda] mkl_fft                   1.0.12           py37h5e564d8_0
[conda] mkl_random                1.0.2            py37h27c97d8_0
[conda] torch                     1.4.0a0+b6113dc          pypi_0    pypi
[conda] torchvision               0.1.8                    pypi_0    pypi

## Additional context

n/a

cc @suo
Repository: flutter
Issue: non-zero status exit from Android emulator process should throwToolExit
Labels: c: crash,platform-android,tool,P2,team-android,triaged-android

When the tool spins up an Android emulator here:

https://github.com/flutter/flutter/blob/a15a81be218f8b2fa2f63d7cd0f8cb0b3a6c2e08/packages/flutter_tools/lib/src/android/android_emulator.dart#L51

the process can come back with a non-zero status and useful information in the message and/or stdout and stderr. Since the tool is unlikely to be able to fix the issues causing the errors, and the error messages from the emulator are usually very informative, the tool should `throwToolExit()` instead of crashing.

/cc @blasten
Repository: TypeScript
Issue: Report error cannot emit file if any of the output file is going to write output of referenced project
Labels: Bug

Found as part of investigating #35468 where referencing project overwrites `index.js` at same location as refereced projects output.
Repository: pytorch
Issue: torch.scatter_logsumexp
Labels: triaged,function request,module: scatter & gather ops

## 🚀 Feature
torch.scatter_add will distribute values over an output tensor, summing if multiple values land in the same destination coordinate.

torch.logsumexp performs addition in linear space of quantities with log-space values, useful for adding probabilities which are stored as log likelihoods, for example.

torch.scatter_logsumexp would behave the same as torch.scatter_add, but instead of linear summing, it would logsumexp to sum.

## Motivation

I am experimenting with alterations to CTC, and python implementations of CTC have to sum probabilities from identical labels in a target sequence to get the total probability of a particular token. The algorithm is much more numerically stable if implemented with log likelihoods instead of linear probabilities, and torch.scatter_logsumexp would simplify this kind of thing.

## Alternatives

Currently either log likelihoods have to be exponential'ed and then scatter_add'ed (numerically unstable), or scattered into a target tensor with an expanded extra dimension (so no two values land together) and then logsumexp'd over that extra dimension



cc @ezyang @gchanan @zou3519
Repository: rust
Issue: Implicit jobserver token is yielded by rayon
Labels: T-compiler,C-bug,WG-compiler-parallel

Rayon is currently yielding the implicit token "owned" by the process which means we can end up in a situation where e.g. a `-j1` build has more than 1 rustc running (even though only one of them is actively running, but they're all consuming memory and other resources, so this is a bug).

The current intended fix is to stop yielding the implicit token by keeping track of the amount of tokens we've acquired/yielded and just skipping the yield (and eventual reacquire) for that implicit token.

cc https://github.com/rust-lang/rust/issues/64750
Repository: TypeScript
Issue: "types" field in package.json pointing to a `.ts` file in node_modules results in the file being compiled and type checked
Labels: Suggestion,Awaiting More Feedback

Continuing from https://github.com/Microsoft/TypeScript/issues/22228

cc @evil-shrike

I have this issue.

@mhegazy said

> the lib has either `"types": "index.ts"` or a `.ts` file at its root. which is wrong. a library should not expose its sources, only its declarations.

But features like inferred return types (f.e. when making class-factory mixins) are not compilable to declaration files, resulting in errors like

```
error TS4025: Exported variable 'html' has or is using private name 'htmlBind'.
error TS4031: Public property '_currentArea' of exported class has or is using private name 'AreaInternal'.
error TS4055: Return type of public method from exported class has or is using private name 'PartHelper'.
error TS4073: Parameter 'partHelper' of public method from exported class has or is using private name 'PartHelper'.
error TS4078: Parameter 'options' of exported function has or is using private name 'ExtendOptions'.
```

> A .d.ts does not have expressions.. it represents the shape of the API.

Not entirely true.

As far as I know, the only way to use features (that declaration files don't support) in downstream projects is to get types directly from `.ts` source files. This makes the need to point `types` to `.ts` source files a valid use case.

---

This is what I think should happen:

If `"types"` points to a `.ts` file, and `"main"` points to a `.js` file, then the compiler should use the `.ts` file only for type definitions and not compile or type-check the code.

`"main"` can serve as a guide to telling the compiler whether it should compile sources, or read js files. `"types"` should be for... specifying the source of _types_.

Unless I missed it, there's no other way to include types for features that aren't representable in declaration files.

Why is it that declaration features don't match source features? It seems that an important goal should be for declaration features to always have the capability of matching source features.
Repository: flutter
Issue: [url_launcher] Result doesn't fire on early dismissal (iOS)
Labels: platform-ios,p: url_launcher,package,P2,team-ios,triaged-ios

If you launch a URL on iOS and hit the Done button before the initial load completes, the FlutterResult never fires back to the caller.

I think the SafariVC delegate method which fires the FlutterResult does not get called in this case.
Repository: go
Issue: cmd/link: should log searching directory
Labels: NeedsInvestigation,compiler/runtime

### What version of Go are you using (`go version`)?

<pre>
$ go version
go version go1.13 linux/amd64
</pre>

### Does this issue reproduce with the latest release?
Yes


### What operating system and processor architecture are you using (`go env`)?

<details><summary><code>go env</code> Output</summary><br><pre>
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOENV="/root/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB="*.ctripcorp.com"
GOOS="linux"
GOPATH="/root/go"
GOPRIVATE=""
GOPROXY="https://goproxy.io,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build028007412=/tmp/go-build -gno-record-gcc-switches"
</pre></details>

### What did you do?

<pre>
$ go tool link -v main.o 
HEADER = -H5 -T0x401000 -R0x1000
searching for runtime.a in /usr/local/go/pkg/linux_amd64/runtime.a
 0.00 deadcode
 0.02 symsize = 0
 0.03 pclntab=251242 bytes, funcdata total 57287 bytes
 0.04 dodata
 0.04 dwarf
 0.11 asmb
 0.11 codeblk
 0.12 rodatblk
 0.12 datblk
 0.12 reloc
 0.12 sym
 0.12 symsize = 2688
 0.13 symsize = 34560
 0.13 dwarf
 0.13 headr
 0.13 cpu time
21167 symbols
34132 liveness data
</pre>


### What did you expect to see?
searching for runtime.a in /usr/local/go/pkg/linux_amd64/


### What did you see instead?
searching for runtime.a in /usr/local/go/pkg/linux_amd64/runtime.a
Repository: create-react-app
Issue: Remove fsevents from optionalDependencies
Labels: issue: proposal

Is there a reason why `fsevents` is in the optional dependencies at the react-scripts package? It's never used.
Repository: TypeScript
Issue: Add support for URI style import
Labels: Suggestion,In Discussion

# Search Terms

browser es module import url

## Suggestion

Related issues: #28985, #19942

In browser and deno, import from a "package" is different from the node style.

```ts
// it's valid in browser but not in TypeScript
import lodash from "https://unpkg.com/lodash-es@4.17.15/lodash.js";

// it's valid in deno but not in TypeScript
import { serve } from "https://deno.land/std@v0.24.0/http/server.ts";
```

Currently there is no way to let TypeScript automatically map the URI to another place like `@types/*` or `$DENO_DIR/deps/https/deno.land/*`

The current `path` can map a simple pattern of import module specifier to another place, but in the URI style import, a more flexible way to map the URI is required.

### Proposal

(maybe add a new `moduleResolution: browser`)
Add a new `uriPaths` that allows to map from a RegExp to a local path. It will NOT effect the emitted code. Just a way to find the type definition for those URIs.

I'm willing to implement this feature but I'm not sure if TypeScript will accept this.

## Use Cases

For TypeScript to find definition file for imports like `https://unpkg.com/lodash`

## Examples

```jsonc
{
  "compilerOptions": {
    "uriPaths": {
      "https://unpkg.com/(.+?)@.+?/.+": "./node_modules/@types/$1",
      "https://deno.land/(.+?)@v.+?/(.+?)/(.+)": "$DENO_DIR/deps/https/deno.land/$1/$2/$3",
      "std:(.+)": "./node_modules/builtin-module-types/$1"
    }
  }
}
```

This rule map https://unpkg.com/lodash-es@4.17.15/lodash.js to `@types/lodash-es`

Map https://deno.land/std@v0.24.0/http/server.ts to `$DENO_DIR/deps/https/deno.land/std/http/server.ts`.

\$DENO_DIR is an environment variable.
By default, on Windows, it's `~\AppData\Local\deno\deps\https\deno.land\std\http\server.ts`.
By default on Linux, it is `~/.deno/deps/https/deno.land/std/http/server.ts`.

## Checklist

My suggestion meets these guidelines:

* [x] This wouldn't be a breaking change in existing TypeScript/JavaScript code
* [x] This wouldn't change the runtime behavior of existing JavaScript code
* [x] This could be implemented without emitting different JS based on the types of the expressions
* [x] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)
* [x] This feature would agree with the rest of [TypeScript's Design Goals](https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals).
Repository: godot
Issue: Make upgrading Godot remove existing .mono and .import directories.
Labels: enhancement,topic:import

**Godot version:** Since the `.mono` and `.import` directories were added.

**OS/device including version:** N/A

**Issue description:** With newer versions of Godot (especially upgrades such as 3.1 to 3.2), `.mono` (and sometimes `.import`) directories, being left untouched, cause issues when building/running/exporting projects that have been upgraded from a previous version. Some mechanism for newer versions of Godot to detect this and remove the `.mono` and/or `.import` directories as required would be useful.
Repository: create-react-app
Issue: HOST is ignored in yarn start command (see #2843 as reference)
Labels: issue: proposal

Reopening of #2843 as it is locked and resolved.

In all Unix networking a bind call is based on HOST and PORT.
E.g. you can bind two servers, one to 123.123.123.123:3000 and one to 127.0.0.1:3000.

The authors in #2843 propose that this is confusing and disallow starting of a dev server (`yarn start`) when the port (ignorant of the host) is already used violating basic unix principles.

This prohibits the use of a dev server behind a proxy, that, e.g. exposes the dev port behind a authorization layer.

I propose to follow standard unix principles and simplify the code by just trying to bind to the host:port combination. If the port is busy node will give an adequate error message, there is no need to use an extra dependency or error message that restricts versatility.
Repository: storybook
Issue: Add Flutter Support
Labels: feature request

I love storybook and would like a Flutter support for it...
I known that today it only works for js frameworks, but can we change it?
Have you considered changing storybookjs to just storybook? i love js stack, but storybook is already big enough to support other languages. Dart for example... 

I can't help a lot bringing it to life, but i know a great project ([Dashbook](https://github.com/erickzanardo/dashbook)) and developer ([Erick Zanardo](https://github.com/erickzanardo)) trying it in storybook standards.
Can we give it a try?

![dashbook](https://user-images.githubusercontent.com/11022437/71094623-0a494980-218a-11ea-9210-55fb4fe06a75.gif)
Repository: godot
Issue: Animation position shifts by  0.0001 second, regardless of animation step size
Labels: bug,topic:editor,regression,topic:animation

I'm using Godot 3.2.beta3 on Windows 10 Home, this issue was the same for beta2.

When using the AnimationPlayer for 2D animation, using a bonerigged (Polygon2D, Skeleton2D, Bone2D) character, when I try to step between keypositions in my animation using the up and down arrows next to the "animation position" text box, the time shifts by 0.0001 second, regardless of what I'm animating on (0.05 second in the example).

I would think this is a bug, since stepping by so little has sadly rendered the arrows useless to me, and I would think it's the same for other animators.

![animationposition](https://user-images.githubusercontent.com/50481103/71097077-b9e4e280-21af-11ea-8edc-c6166d92352a.png)
Repository: rust
Issue: Missing StorageLive and StorageDead Statements for some locals
Labels: T-compiler,A-MIR,C-bug

It seems that the StorageLive and StorageDead statements are not generated for every local of a function.

I tried this code:
```rust
pub fn main() {
    let mut x = 5;
    x = call(x);
}

fn call(i: usize) -> usize {
    i * 2
}
```

I expected to see something like this happen:
```
fn  call(_1: usize) -> usize {
    let mut _0: usize;
    let mut _2: usize;
    let mut _3: (usize, bool);

    bb0: {
        StorageLive(_2);
        _2 = _1;
        StorageLive(_3);  // ADDED
        _3 = CheckedMul(move _2, const 2usize);
        assert(!move (_3.1: bool), "attempt to multiply with overflow") -> bb1;
    }

    bb1: {
        _0 = move (_3.0: usize);
        StorageDead(_2);
        StorageDead(_3);  // ADDED
        return;
    }
}
```

Instead, this happened:
```
fn  call(_1: usize) -> usize {
    let mut _0: usize;
    let mut _2: usize;
    let mut _3: (usize, bool);

    bb0: {
        StorageLive(_2);
        _2 = _1;
        _3 = CheckedMul(move _2, const 2usize);
        assert(!move (_3.1: bool), "attempt to multiply with overflow") -> bb1;
    }

    bb1: {
        _0 = move (_3.0: usize);
        StorageDead(_2);
        return;
    }
}
```

## Meta
`rustc --version --verbose`:
rustc 1.41.0-nightly (25d8a9494 2019-11-29)
binary: rustc
commit-hash: 25d8a9494ca6d77361e47c1505ecf640b168819e
commit-date: 2019-11-29
host: x86_64-unknown-linux-gnu
release: 1.41.0-nightly
LLVM version: 9.0

Reproducable on [Rust Playgound](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&code=pub%20fn%20main()%20%7B%0A%20%20%20%20let%20mut%20x%20%3D%205%3B%0A%20%20%20%20x%20%3D%20call(x)%3B%0A%7D%0A%0Afn%20call(i%3A%20usize)%20-%3E%20usize%20%7B%0A%20%20%20%20i%20*%202%0A%7D%0A) in stable and nightly channel
Repository: godot
Issue: VERTEX in canvas_item shader: visibility problem
Labels: enhancement,topic:rendering,confirmed,topic:shaders,topic:2d

**Godot version:**
3.2 beta 4
**OS/device including version:**
Windows 7
**Issue description:**
Hello everyone, I find it difficult to unambiguously attribute this to a bug or a flaw, there was the following problem: when Sprite or Polygon2D is entirely off the screen, the engine does not draw it, and this is logical. But if it is slightly expanded by moving VERTEX in the Shader (canvas_item), then a piece of the object will fall into the area of the screen, but it will not be drawn anyway, apparently, due to the fact that the processing of the Shader occurs after checking the location in the screen or viewport. Is there a tool to solve the problem? (for example, somehow forcibly specify that this object should be drawn.)
**Steps to reproduce:**
Place the Sprite or Polygon2d outside the screen or viewport, then in the canvas_item Shader change the VERTEX position so that the visible part of the object is inside the screen.
**Minimal reproduction project:**
https://github.com/mishkarch/vertex-bug
Repository: pytorch
Issue: Add option in LSTM layer to access all cell states of all time steps
Labels: feature,module: nn,module: rnn,triaged

## 🚀 Feature
<!-- A clear and concise description of the feature proposal -->
The LSTM layer in torch.nn should have the option to output the cell states of all time steps along with the hidden states of each time step.

## Motivation

<!-- Please outline the motivation for the proposal. Is your feature request related to a problem? e.g., I'm always frustrated when [...]. If this is related to another GitHub issue, please link here too -->
When implementing Recurrent Replay Distributed DQN (R2D2), [See here.](https://openreview.net/forum?id=r1lyTjAqYX) I need access to all the hidden states and cell states of all the time steps of a sequence. Those hidden states and cell states are stored in an array to later on continue training the LSTM based network from a different time step. This is possible using the LSTMCell and a for-loop. But this painfully slow, around 15-30 times slower than using an LSTM layer, even when using a GPU. 

This is the first major roadblock that I encountered when using PyTorch because it hinders me from using the R2D2 technique, as the current technique of using LSTMCells is simply way too slow.

## Pitch

<!-- A clear and concise description of what you want to happen. -->
I would like a flag in the LSTM layer which can be toggled to True, which will change the output behavior of the LSTM layer from ` output, (h_n, c_n)` to `output, cell_states, (h_n, c_n)`. Output comprises all hidden states (h_1, ... h_n) and cell_states comprises all cell states (c_1, c_n). The name of the flag could be "return_states" or "return_cell_states".

## Alternatives

<!-- A clear and concise description of any alternative solutions or features you've considered, if any. -->
An alternative solution would be to somehow add a way to make the speed of using LSTMCells match the speed of the LSTM layer. This seems quite difficult to me to achieve.

## Additional Context:

Other people seem to have this issue as well, see [here](https://discuss.pytorch.org/t/lstm-internal-cells-for-each-state/9987/3) or [here](https://discuss.pytorch.org/t/how-to-get-cell-states-for-each-timestep-from-nn-lstm/10907/5).

cc @zou3519
Repository: pytorch
Issue: cuDNN convolution does not handle empty input tensor
Labels: module: cudnn,module: cuda,triaged,small

## 🐛 Bug

Discovered by @ngimel 

code
```python
import torch

print(torch.__version__)
print(torch.version.cuda)
b = torch.nn.Conv2d(32, 32, 2, bias=False, padding=1)
a = torch.randn(2, 32, 0, 5)
print('cpu:', b(a).shape)
b.cuda()
a = a.cuda()
print('cuda:', b(a).shape)
```

output
```
1.4.0.dev20191217
10.1
cpu: torch.Size([2, 32, 1, 6])
Traceback (most recent call last):
  File "conv-empty.py", line 10, in <module>
    print('cuda:', b(a).shape)
  File "/home/xgao/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 539, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/xgao/anaconda3/lib/python3.7/site-packages/torch/nn/modules/conv.py", line 345, in forward
    return self._conv_forward(input, self.weight)
  File "/home/xgao/anaconda3/lib/python3.7/site-packages/torch/nn/modules/conv.py", line 342, in _conv_forward
    self.padding, self.dilation, self.groups)
RuntimeError: cuDNN error: CUDNN_STATUS_BAD_PARAM

```

## Environment

```
PyTorch version: 1.4.0.dev20191217
Is debug build: No
CUDA used to build PyTorch: 10.1

OS: Ubuntu 18.04.3 LTS
GCC version: (Ubuntu 8.3.0-6ubuntu1~18.04.1) 8.3.0
CMake version: version 3.14.0

Python version: 3.7
Is CUDA available: Yes
CUDA runtime version: 10.1.324
GPU models and configuration: 
GPU 0: Tesla V100-DGXS-16GB
GPU 1: Tesla V100-DGXS-16GB
GPU 2: Tesla V100-DGXS-16GB
GPU 3: Tesla V100-DGXS-16GB

Nvidia driver version: 430.50
cuDNN version: /usr/lib/x86_64-linux-gnu/libcudnn.so.7.5.0

Versions of relevant libraries:
[pip] numpy==1.17.2
[pip] numpydoc==0.9.1
[pip] pytorch-ignite==0.2.1
[pip] torch==1.4.0.dev20191217
[pip] torch-nightly==1.2.0.dev20190722
[pip] torchani==1.0.2.dev29+gd32081e
[pip] torchvision==0.4.2
[conda] blas                      1.0                         mkl  
[conda] magma-cuda100             2.5.1                         1    pytorch
[conda] magma-cuda101             2.5.1                         1    pytorch
[conda] mkl                       2019.4                      243  
[conda] mkl-include               2019.4                      243  
[conda] mkl-service               2.3.0            py37h516909a_0    conda-forge
[conda] mkl_fft                   1.0.15           py37h516909a_1    conda-forge
[conda] mkl_random                1.1.0            py37hb3f55d8_0    conda-forge
[conda] pytorch-ignite            0.2.1                    pypi_0    pypi
[conda] torch                     1.4.0.dev20191217          pypi_0    pypi
[conda] torch-nightly             1.2.0.dev20190722          pypi_0    pypi
[conda] torchani                  1.0.2.dev29+gd32081e           dev_0    <develop>
[conda] torchvision               0.4.2                    pypi_0    pypi
```

cc @ngimel @csarofeen @ptrblck @ezyang @gchanan @zou3519