sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: pytorch
Issue: `cat` fails the gradient computation in forward mode with empty tensors when used with legacy vmap
Labels: triaged,module: edge cases,module: forward ad

### 🐛 Describe the bug

`cat` fails the gradient computation in forward mode but succeeds in reverse mode

```py
import torch
from torch.autograd.functional import jacobian

torch.manual_seed(420)

x = torch.randn(4, 3, 32, 32)
empty = torch.Tensor([])

def func(x, empty):
    res1 = torch.cat([x, empty], dim=1)
    return res1

jacobian(func, (x, empty), vectorize=True, strategy="reverse-mode")
# succeed 
jacobian(func, (x, empty), vectorize=True, strategy="forward-mode")
# RuntimeError: Tensors must have same number of dimensions: got 5 and 2
```

### Versions

```
PyTorch version: 2.0.0.dev20230105
Is debug build: False
CUDA used to build PyTorch: 11.7
ROCM used to build PyTorch: N/A

OS: Ubuntu 22.04.1 LTS (x86_64)
GCC version: (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0
Clang version: Could not collect
CMake version: version 3.22.1
Libc version: glibc-2.35

Python version: 3.9.15 (main, Nov 24 2022, 14:31:59)  [GCC 11.2.0] (64-bit runtime)
Python platform: Linux-5.15.0-56-generic-x86_64-with-glibc2.35
Is CUDA available: True
CUDA runtime version: 11.7.99
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration:
GPU 0: NVIDIA GeForce RTX 3090
GPU 1: NVIDIA GeForce RTX 3090
GPU 2: NVIDIA GeForce RTX 3090

Nvidia driver version: 515.86.01
cuDNN version: Probably one of the following:
/usr/lib/x86_64-linux-gnu/libcudnn.so.8.4.1
/usr/lib/x86_64-linux-gnu/libcudnn_adv_infer.so.8.4.1
/usr/lib/x86_64-linux-gnu/libcudnn_adv_train.so.8.4.1
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_infer.so.8.4.1
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_train.so.8.4.1
/usr/lib/x86_64-linux-gnu/libcudnn_ops_infer.so.8.4.1
/usr/lib/x86_64-linux-gnu/libcudnn_ops_train.so.8.4.1
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

Versions of relevant libraries:
[pip3] numpy==1.23.5
[pip3] torch==2.0.0.dev20230105
[pip3] torchaudio==2.0.0.dev20230105
[pip3] torchvision==0.15.0.dev20230105
[conda] blas                      1.0                         mkl
[conda] mkl                       2021.4.0           h06a4308_640
[conda] mkl-service               2.4.0            py39h7f8727e_0
[conda] mkl_fft                   1.3.1            py39hd3c417c_0
[conda] mkl_random                1.2.2            py39h51133e4_0
[conda] numpy                     1.23.5           py39h14f4228_0
[conda] numpy-base                1.23.5           py39h31eccc5_0
[conda] pytorch                   2.0.0.dev20230105 py3.9_cuda11.7_cudnn8.5.0_0    pytorch-nightly
[conda] pytorch-cuda              11.7                 h67b0de4_2    pytorch-nightly
[conda] pytorch-mutex             1.0                        cuda    pytorch-nightly
[conda] torchaudio                2.0.0.dev20230105      py39_cu117    pytorch-nightly
[conda] torchtriton               2.0.0+0d7e753227            py39    pytorch-nightly
[conda] torchvision               0.15.0.dev20230105      py39_cu117    pytorch-nightly
```
Repository: godot
Issue: [C# Beta 17] Editor Freezes after opening up 2 scenes with animation rigs and then playing the game 2 times and then closing the game
Labels: bug,topic:core,topic:editor,needs testing

### Godot version

v4.0.beta17.mono.official [c40020513]

### System information

Windows 10, RX 6600, Intel 10400

### Issue description

Opening 2 specific scenes with animation rigs, then playing the game, then closing the game, then playing the game a 2nd and closing it will cause the Godot game and editor to freeze with no errors in Godot console or verbose console.

Picture of what it looks like when game window and godot editor freeze up.

![Capture](https://user-images.githubusercontent.com/6277739/216742292-84d6300d-9bdb-4dc2-a438-03508969b29c.PNG)

### Steps to reproduce

1. Download the Zombies.zip found below
2. Open the scene called "Zed" located in `Root/Zed`
3. Open the scene called "Zombie" located in `Root/Zombie`

*so now you should have 3 scenes open: `Main`, `Zombie` and `Zombie_v2`*

4. Run the game
5. Close the game
6. Run the game a 2nd time
7. Close it again
8. Notice how both the game window and godot editor freeze up (this freezing never goes away)

### Minimal reproduction project

[Zombies.zip](https://github.com/godotengine/godot/files/10593811/Zombies.zip)
Repository: PowerToys
Issue: Mouse
Labels: Idea-Enhancement,Needs-Triage,Product-Mouse Utilities

### Description of the new feature / enhancement

Exchange of left and right mouse buttons.

### Scenario when this would be used?

To prevent tenosynovitis, the left and right mice are used alternately.

### Supporting information

When the left and right buttons are swapped, the cursor is also mirrored.
Repository: PowerToys
Issue: 摄像头一键关闭
Labels: Needs-Triage

### Description of the new feature / enhancement

在启动会议软件时，显示一个摄像头的小图标在上方。用户可以用来禁用摄像头

### Scenario when this would be used?

在工作时，云会议都选择不露脸，但目前不可以

### Supporting information

_No response_
Repository: excalidraw
Issue: Esc doesn't work to close HELP menu
Labels: keyboard

When you open color select above help menu, you can not close help menu using esc
Repository: stable-diffusion-webui
Issue: [Bug]: Model Merg not working as expected.
Labels: bug-report

### Is there an existing issue for this?

- [X] I have searched the existing issues and checked the recent builds/commits

### What happened?

while testing merges I noticed that it doesn't interpolate correctly. 

### Steps to reproduce the problem

make a merge between two models with weights from 0.1 to 0.9

### What should have happened?

the two models near the ends 0.1 and 0.9 weights should look similar to the initial models.

### Commit where the problem happens

226d840e84c5f306350b0681945989b86760e616

### What platforms do you use to access the UI ?

Windows

### What browsers do you use to access the UI ?

Google Chrome

### Command Line Arguments

```Shell
xformers
```


### List of extensions

no

### Console logs

```Shell
Don't think it's necessary.
```


### Additional information

See the xy plot 

https://i.imgur.com/WNt8CUm.jpg

I am generating an xy plot with random seed and interpolating between two models from 0.1 to 0.9. in this case a model called Z.2 and a model called A.5
What I expected was that the ending Model B.9 would be similar to that of A.5 But its not. so I reversed the order of the way the models were merged and made series C and they are completely different. 
you can notice that series B and series C seem to interpolate smoothly from the intial model to 0.1 but 0.9 is not like the last model. 

I think that the model is only interpolating half as much as it should be. so that 0.9 is actually more like 0.45
Repository: pytorch
Issue: faster WeightedRandomSampler implementation based on alias method
Labels: module: dataloader,triaged

### 🚀 The feature, motivation and pitch

Since the weights are discrete and often fixed, I think the `WeightedRandomSampler` with replacement could be based on [alias method](https://en.wikipedia.org/wiki/Alias_method). In this implementation, the random values can be drawn from the distribution in O(1) time. The weight list has the same size as the dataset. When it comes to large datasets, the new method can be better.
Here is my solution, I implemented a `WeightedRandomSampler2` with scipy:
```python
from torch.utils.data import WeightedRandomSampler
from scipy.stats.sampling import DiscreteAliasUrn

class WeightedRandomSampler2(WeightedRandomSampler):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        urng = np.random.default_rng()
        self.rng = DiscreteAliasUrn(self.weights, random_state=urng)
        
    def __iter__(self):
        if self.replacement:
            yield from iter(self.rng.rvs(self.num_samples))
        else:
            return super().__iter__()
```

### Alternatives

https://www.keithschwarz.com/darts-dice-coins/
https://github.com/Tecnarca/Vose-Alias-Method
https://gist.github.com/orlp/e9b31d3397a7dd3e34d6bc862ce3b88d

### Additional context

```python
import numpy as np
w = np.random.random(10_000_000)
w /= w.sum()
```

```python
%%time
s1 = WeightedRandomSampler(w, 3)
```
>Wall time: 0 ns

```python
%%time
list(s1)
```
>Wall time: 63.1 ms
[729931, 4124692, 4903810]

```python
%%time
s2 = WeightedRandomSampler2(w, 3)
```
>Wall time: 235 ms

```python
%%time
list(s2)
```
>Wall time: 0 ns
[3887197, 7289214, 2292607]

We can see that although the initialization of `WeightedRandomSampler2` is slower, its random number generation is much faster. Typically, the initialization runs only once, while the generation runs tens of thousands of times. 
Furthermore, if given a larger weight list, say `w = np.random.random(100_000_000)`, the `WeightedRandomSampler` will raise a `RuntimeError: number of categories cannot exceed 2^24`, but the number generation of the `WeightedRandomSampler2` still tasks `Wall time: 0 ns`.
Therefore, I propose to implement the sampler using alias method.

cc @SsnL @VitalyFedyunin @ejguan @NivekT
Repository: godot
Issue: rpc-call in _ready() for spawned node fails to find target node on Client (Server/Client in the same SceneTree)
Labels: topic:network

### Godot version

v4.0.beta17.mono.official [c40020513]

### System information

Windows 10

### Issue description

- We have two `SceneMultiplayer` setup in the same scene, one Client, and one Server.
- Each have a `MultiplayerSpawner`
- We spawn a Node on the Server, "Entity", which calls an RPC on itself in `_ready()`
- The RPC call from Client -> Server succeeds
- The RPC call from Server -> Client fails, with this error:

```
E 0:00:02:0241   get_node: Node not found: "Entity" (relative to "/root/App/Client").
  <C++ Error>    Method/function failed. Returning: nullptr
  <C++ Source>   scene/main/node.cpp:1364 @ get_node()

E 0:00:02:0241   process_simplify_path: Condition "node == nullptr" is true.
  <C++ Source>   modules/multiplayer/scene_cache_interface.cpp:77 @ process_simplify_path()

E 0:00:02:0241   get_node: Node not found: "Entity" (relative to "/root/App/Client").
  <C++ Error>    Method/function failed. Returning: nullptr
  <C++ Source>   scene/main/node.cpp:1364 @ get_node()

E 0:00:02:0241   _process_get_node: Failed to get path from RPC: Entity.
  <C++ Source>   modules/multiplayer/scene_rpc_interface.cpp:165 @ _process_get_node()

E 0:00:02:0242   process_rpc: Invalid packet received. Requested node was not found.
  <C++ Error>    Condition "node == nullptr" is true.
  <C++ Source>   modules/multiplayer/scene_rpc_interface.cpp:228 @ process_rpc()
```


**Quirks**
- If we delay the RPC-call one frame, in `_ready()`, then it works
- If we "inject" network latency for all UDP-packets between Server/Client, then it also works, and we don't need to delay the RPC call one frame (!)

### Steps to reproduce

- Open attached sample project
- Run the game, and click the "Spawn Entity"-button
- Check the Debugger Errors
- Optionally, open "entity.gd" and uncomment the `await`-line, and run again. It should work then.

### Minimal reproduction project

[rpc_in_ready_bug.zip](https://github.com/godotengine/godot/files/10608244/rpc_in_ready_bug.zip)
Repository: pytorch
Issue: Asking for a LAZYMODULEMIXIN warning
Labels: module: nn,module: molly-guard,triaged,module: lazy

Hi, I spent several days trying to understand why a gcn model (from pytorch geometric) produced different results on different runs, despite the manual seed setting.

The answer was due to the way lazy modules in PyTorch initialize parameters differently than other modules in a same ML model. (as described here: https://pytorch.org/docs/stable/generated/torch.nn.modules.lazy.LazyModuleMixin.html ). To mitigate this unpleasant situation, could you add a warning about reproducibility of experiments when using a lazy module? Thank you in advance

cc @albanD @mruberry @jbschlosser @walterddr @saketh-are
Repository: vscode
Issue: Make history service work with debounced editor events
Labels: feature-request,perf,editor-input,workbench-history,keep

https://github.com/microsoft/vscode/pull/163845 was an attempt to defer events for history service processing but it caused https://github.com/microsoft/vscode/issues/173109 so I reverted it.

https://github.com/microsoft/vscode/issues/173111 is a related issue where disposing a debounced event emitter looses events when disposed before the timeout is hit.

Even if https://github.com/microsoft/vscode/issues/173111 is addressed, we process editor events in a way that we ask the editor for its selection and when events are debounced, the editor may no longer be what we expect.

https://github.com/microsoft/vscode/blob/43db9d2d06df4ff7b7f029b30bbdaea51b8f16f5/src/vs/workbench/services/history/browser/historyService.ts#L1479

https://github.com/microsoft/vscode/blob/43db9d2d06df4ff7b7f029b30bbdaea51b8f16f5/src/vs/workbench/services/history/browser/historyService.ts#L1493

So if we want to bring back debouncing to the history service, we cannot ask the editor at all for any information.
Repository: vscode
Issue:  Dim Inactive Regions not working colorTheme Default High Contrast dark
Labels: bug,themes

Type: <b>Bug</b>

 Dim Inactive Regions not working colorTheme Default High Contrast dark

![image](https://user-images.githubusercontent.com/44687671/216768789-72b98803-aba2-47ed-a5c2-733ae359724b.png)




VS Code version: Code 1.75.0 (e2816fe719a4026ffa1ee0189dc89bdfdbafb164, 2023-02-01T15:23:45.584Z)
OS version: Windows_NT x64 10.0.19045
Modes:
Sandboxed: No
Remote OS version: Linux x64 5.15.79.1-microsoft-standard-WSL2

<details>
<summary>System Info</summary>

|Item|Value|
|---|---|
|CPUs|Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz (12 x 3696)|
|GPU Status|2d_canvas: enabled<br>canvas_oop_rasterization: disabled_off<br>direct_rendering_display_compositor: disabled_off_ok<br>gpu_compositing: enabled<br>multiple_raster_threads: enabled_on<br>opengl: enabled_on<br>rasterization: enabled<br>raw_draw: disabled_off_ok<br>skia_renderer: enabled_on<br>video_decode: enabled<br>video_encode: enabled<br>vulkan: disabled_off<br>webgl: enabled<br>webgl2: enabled<br>webgpu: disabled_off|
|Load (avg)|undefined|
|Memory (System)|31.94GB (16.69GB free)|
|Process Argv|--crash-reporter-id c6d44ad5-28f0-4d14-995a-ad6fd6cd6b67|
|Screen Reader|no|
|VM|0%|

|Item|Value|
|---|---|
|Remote|WSL: Ubuntu|
|OS|Linux x64 5.15.79.1-microsoft-standard-WSL2|
|CPUs|Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz (12 x 3696)|
|Memory (System)|15.59GB (14.45GB free)|
|VM|0%|
</details><details><summary>Extensions (15)</summary>

Extension|Author (truncated)|Version
---|---|---
language-x86-64-assembly|13x|3.0.0
better-cpp-syntax|jef|1.17.2
l13-diff|L13|1.0.3
vscode-language-pack-ko|MS-|1.75.2023020109
remote-wsl|ms-|0.75.1
doxdocgen|csc|1.4.0
gitlens|eam|13.2.0
better-cpp-syntax|jef|1.17.2
l13-diff|L13|1.0.3
vscode-language-pack-ko|MS-|1.75.2023020109
csharp|ms-|1.25.4
cmake-tools|ms-|1.13.45
cpptools|ms-|1.13.9
cpptools-extension-pack|ms-|1.3.0
cmake|twx|0.0.17

(2 theme extensions excluded)

</details><details>
<summary>A/B Experiments</summary>

```
vsliv368:30146709
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
pythonvspyl392:30443607
vserr242:30382549
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
pythondataviewer:30285071
vscod805cf:30301675
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
cmake_vspar411:30581797
vsaa593cf:30376535
pythonvs932:30410667
cppdebug:30492333
vscaat:30438848
vsclangdc:30486549
c4g48928:30535728
dsvsc012:30540252
azure-dev_surveyone:30548225
pyindex848cf:30577861
nodejswelcome1:30587005
282f8724:30602487
f6dab269:30613381
pythonsymbol12:30657548
2i9eh265:30646982

```

</details>

<!-- generated by issue reporter -->
Repository: flutter
Issue: `PageView.onPageChanged` called with incorrect value when using `jumpToPage`
Labels: framework,has reproducible steps,P2,found in release: 3.7,found in release: 3.8,team-framework,triaged-framework

## Steps to Reproduce

1. PageView has a few pages. (ex. 6 pages)
2. A new page is added at the end of the pageview. (ex. index is 6)
3. pageController.jumpToPage to the last page(index 6). (between 2, 3 steps, there is plenty of time to redraw widget

**Expected results:** 
onPageChanged called with the last-1 page (index is 5)

**Actual results:**
onPageChanged called with the last page (index is 6)
Repository: neovim
Issue: neovim does not detect python on Windows 11
Labels: bug,platform:windows,provider,has:vim-patch,filesystem

### Describe the bug

I am not able to get neovim to detect python 3 on Windows 11 pro. I made several attempts.

1)
- installed python 3.10 (and also 3.7 after uninstalling 3.10) from the Microsoft Store
- installed neovim 0.8.2 via chocolatey
- followed the guide https://neovim.io/doc/user/provider.html + stackoverlow question and answers. I am sure I used correct path, keys, etc.

nvim has never detected a python provider able to import neovim (tested within several shells)

2)
- uninstalled python got via the MS app store
- installed python 3.11 via chocolatey
same results sa above.

Every time I ran `:checkhealth` and got this:
```
## Python 3 provider (optional)
  - INFO: Using: g:python3_host_prog = "C:/Python311/python.exe"
  - WARNING: No Python executable found that can `import neovim`. Using the first available executable for diagnostics.
  - INFO: Executable: Not found

## Python virtualenv
  - OK: no $VIRTUAL_ENV
```
This last message corresponds to the attempt with choco installation.

But then I can:
```
C:\>python --version
Python 3.11.0

C:\>python
Python 3.11.0 (main, Oct 24 2022, 18:26:48) [MSC v.1933 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import neovim
>>> import pynvim
>>> print(neovim.__file__)
C:\Users\user\AppData\Roaming\Python\Python311\site-packages\neovim\__init__.py
>>> print(pynvim.__file__)
C:\Users\user\AppData\Roaming\Python\Python311\site-packages\pynvim\__init__.py
```

NOTE:  In all cases I also uninstalled and reinstalled neovim via chocolatey. I tried to specify the path with /, \\, etc. single quotes double quotes. I think I did not leave anything untested.

In ALL cases, in all shells I could just execute `python` and `import neovim` or `import pynvim` without issues (as shown above)

If neovim on windows is supposed to detect python, I think there is a bug somewhere.




### Steps to reproduce

Described above. Basically follow the instructions to use python with neovim.

### Expected behavior

I would expect neovim to detect the python provider


### Neovim version (nvim -v)

0.8.3

### Vim (not Nvim) behaves the same?

not installed

### Operating system/version

Windows 11

### Terminal name/version

Windows Terminal, git bash, command promp, powershell

### $TERM environment variable

none

### Installation

choco / windows store
Repository: godot
Issue: Changing the hash in _get_customization_configuration_hash for EditorExportPlugin doesn't re-run the export
Labels: discussion,topic:editor,topic:export

### Godot version

4.0.beta17

### System information

Linux

### Issue description

Overriding _get_customization_configuration_hash in a custo export plugin and returning a different hash (based on the git tag, for example) will not re-export all the scenes and resources, but only those that changed. If that's the case, it's not really understandable why this hash even exists, if it does not force a re-run.

### Steps to reproduce

- Create a custom export plugin
- Export twice without changing anything except the returned hash

### Minimal reproduction project

```gdscript
extends EditorExportPlugin

var hash_array: int
var git_hash: String

func _export_begin(features: PackedStringArray, debug: bool, path: String, flags: int):
    var git_output = []
    var git_exec = OS.execute("git", ["log", "--pretty=format:%h", "-n", "1"], git_output)
    if git_exec != -1: git_hash = git_output[0]
    print(git_hash)

func _get_name() -> String:
    return "ExportPlugin"

func _get_customization_configuration_hash() -> int:
    return hash_array
    
func _begin_customize_scenes(platform: EditorExportPlatform, features: PackedStringArray) -> bool:
    hash_array = git_hash.hash()

    return true

func _customize_scene(scene: Node, path: String) -> Node:
    # This only gets printed once
    print(git_hash)

    return scene
```
Repository: stable-diffusion-webui
Issue: [Bug]: so looooog to generate 1 image on mac Book air , M1, 8go
Labels: bug-report

### Is there an existing issue for this?

- [X] I have searched the existing issues and checked the recent builds/commits

### What happened?

My Mac Book Air M1 with 8GB of memory takes 2-3 minutes to generate a simple image. I tried the recommended fixes (medvram and lowvram) but the performance only got worse and the images generated are not usable. Has anyone found a solution to this issue?

### Steps to reproduce the problem

.

### What should have happened?

.

### Commit where the problem happens

.

### What platforms do you use to access the UI ?

MacOS

### What browsers do you use to access the UI ?

Google Chrome

### Command Line Arguments

```Shell
.
```


### List of extensions

.

### Console logs

```Shell
.
```


### Additional information

_No response_