sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: pytorch
Issue: Feature Request: dim parameter of torch.nn.functional.normalize should accept tuples
Labels: feature,module: nn,triaged,actionable,module: norms and normalization,Stale

### 🐛 Describe the bug

torch.nn.functional.normalize only accepts ints for the dim parameter, however should work in the multidim case

The following code works as expected, however mypy will fail as `dim` is typed as an int.
```
import torch
import torch.nn.functional as F

F.normalize(torch.rand(2,3,4), dim=(0,1))
```

### Versions

Collecting environment information...
PyTorch version: 1.10.0
Is debug build: False
CUDA used to build PyTorch: 11.2
ROCM used to build PyTorch: N/A

OS: Ubuntu 18.04.5 LTS (x86_64)
GCC version: (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
Clang version: Could not collect
CMake version: version 3.15.5
Libc version: glibc-2.27

Python version: 3.9.7 | packaged by conda-forge | (default, Sep 29 2021, 19:20:46)  [GCC 9.4.0] (64-bit runtime)
Python platform: Linux-5.4.0-1064-azure-x86_64-with-glibc2.27
Is CUDA available: True
CUDA runtime version: 10.1.243
GPU models and configuration:
GPU 0: Tesla V100-PCIE-16GB
GPU 1: Tesla V100-PCIE-16GB
GPU 2: Tesla V100-PCIE-16GB
GPU 3: Tesla V100-PCIE-16GB

Nvidia driver version: 460.91.03
cuDNN version: /usr/lib/x86_64-linux-gnu/libcudnn.so.7.6.5
HIP runtime version: N/A
MIOpen runtime version: N/A

Versions of relevant libraries:
[pip3] efficientnet-pytorch==0.6.3
[pip3] mypy==0.910
[pip3] mypy-extensions==0.4.3
[pip3] numpy==1.21.3
[pip3] pytorch-lightning==1.5.0
[pip3] segmentation-models-pytorch==0.2.0
[pip3] torch==1.10.0
[pip3] torchmetrics==0.6.0
[pip3] torchvision==0.11.1
[conda] cudatoolkit               11.5.0               h36ae40a_9    conda-forge
[conda] efficientnet-pytorch      0.6.3                    pypi_0    pypi
[conda] libblas                   3.9.0            12_linux64_mkl    conda-forge
[conda] libcblas                  3.9.0            12_linux64_mkl    conda-forge
[conda] liblapack                 3.9.0            12_linux64_mkl    conda-forge
[conda] magma                     2.5.4                h6103c52_2    conda-forge
[conda] mkl                       2021.4.0           h8d4b97c_729    conda-forge
[conda] mypy                      0.910                    pypi_0    pypi
[conda] mypy-extensions           0.4.3                    pypi_0    pypi
[conda] numpy                     1.21.3           py39hdbf815f_1    conda-forge
[conda] pytorch                   1.10.0          cuda112py39h4e14dd4_0    conda-forge
[conda] pytorch-gpu               1.10.0          cuda112py39h0bbbad9_0    conda-forge
[conda] pytorch-lightning         1.5.0                    pypi_0    pypi
[conda] segmentation-models-pytorch 0.2.0                    pypi_0    pypi
[conda] torchmetrics              0.6.0                    pypi_0    pypi
[conda] torchvision               0.11.1                   pypi_0    pypi

cc @albanD @mruberry @jbschlosser @walterddr @kshitij12345
Repository: create-react-app
Issue: yarn start failed after upgrading 
Labels: issue: install problem,needs triage

i have upgraded react-scripts to v5 and node to v16 & i get error when starting the project knowing that I have reinstalled node_modules. 

![image (1)](https://user-images.githubusercontent.com/77384740/146532094-cd04e520-337a-4278-b2b3-f00e7e95dfcd.png)

output :
yarn run v1.22.5
$ react-scripts start
Failed to compile.

For the selected environment is no default script chunk format available:
JSONP Array push can be chosen when 'document' or 'importScripts' is available.
CommonJs exports can be chosen when 'require' or node builtins are available.
Make sure that your 'browserslist' includes only platforms that support these features or select an appropriate 'target' to allow selecting a chunk format by default. Alternatively specify the 'output.chunkFormat' directly.

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Repository: pytorch
Issue: torch jit script segm fault
Labels: oncall: jit,Stale

### 🐛 Describe the bug

Python crashes on executing the following code:
```python
import torch
from torch import Tensor
from typing import Optional, Union, List, Tuple

print(torch.__version__)

def func(center: Optional[Union[List[int], Tuple[int, int], Tensor]] = None) -> Tensor:

    center_f = [0.0, 0.0]

    if not isinstance(center, Tensor):
        return torch.tensor(center_f)

    return center


s_func = torch.jit.script(func)
> 1.11.0.dev20211217+cu111
Segmentation fault (core dumped)
```

### Versions

Pytorch nightly: 1.11.0.dev20211217+cu111
Repository: rust
Issue: Returning the result of reborrowing in pattern matching causes compilation error
Labels: A-borrow-checker,T-lang,T-compiler,C-bug,D-confusing,A-patterns,fixed-by-polonius

This fails to compile on latest stable (and nightly) ([playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=5261b3aaad8916d45f9a076c129ff5f3)):
```rust
fn f(a: &mut [u8]) -> &mut [u8] {
    match a {
        [b @ ..] if false => b,
        aa => aa,
    }
}
```
```text
error[E0505]: cannot move out of `a` because it is borrowed
 --> src/main.rs:6:9
  |
3 |   fn f(a: &mut [u8]) -> &mut [u8] {
  |           - let's call the lifetime of this reference `'1`
4 | /     match a {
5 | |         [b @ ..] if false => b,
  | |          ------ borrow of `a[..]` occurs here
6 | |         aa => aa,
  | |         ^^ move out of `a` occurs here
7 | |     }
  | |_____- returning this value requires that `a[..]` is borrowed for `'1`
```

This seems like a bug in `rustc`, especially considering that any of the following are compiling just fine ([playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=bb01aa72fab3f6c346f6b4abae6ba588)):
```rust
fn f1(a: &mut [u8]) -> &mut [u8] {
    match a {
        b if false => b,
        aa => aa,
    }
}

fn f2(a: &mut [u8]) -> &mut [u8] {
    match a {
        b if false => b,
        [aa @ ..] => aa,
    }
}

fn f3(a: &mut [u8]) -> &mut [u8] {
    match a {
        [..] if false => a,
        [aa @ ..] => aa,
    }
}
```
----

Originally I've found this bug with code like this ([playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=c0cc979d9b24e3400ba50369572d7bcc)):
```rust
fn original(a: &mut [u8]) -> &mut [u8] {
    match a {
        [.., b] if false => core::slice::from_mut(b),
        [aa @ ..] => aa,
        //^ cannot borrow `a[..]` as mutable more than once at a time
    }
}
```

## Meta

rustc
- stable: `1.57.0`
- nightly: `1.59.0-nightly (2021-12-13 8f117a77d0880ed59afc)`
Repository: transformers
Issue: Support on Mixture of expert models
Labels: New model

Hi, I find that there are emerging works in the field of NLP on **Mixture of experts** based models, such as Switch Transformers from Google. However, I do not find such mixture of expert models in huggingface transformers. Do you have the plan to support such models? Thanks !
Repository: rust
Issue: Unhelpful diagnostic for sort_by_key lifetime issue
Labels: A-diagnostics,A-lifetimes,A-associated-items,T-compiler,D-confusing,D-terse

Given the following code: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=132fc68312d40c6ed0d878b1d5bdb711

```rust
fn parse_filename(file: &std::fs::DirEntry) -> &str {
    todo!()
}

fn foo(mut files: Vec<std::fs::DirEntry>) {
    files.sort_by_key(parse_filename);
}
```

The current output is:

```
error[E0308]: mismatched types
 --> src/lib.rs:6:11
  |
6 |     files.sort_by_key(parse_filename);
  |           ^^^^^^^^^^^ one type is more general than the other
  |
  = note: expected associated type `<for<'r> fn(&'r DirEntry) -> &'r str {parse_filename} as FnOnce<(&DirEntry,)>>::Output`
             found associated type `<for<'r> fn(&'r DirEntry) -> &'r str {parse_filename} as FnOnce<(&DirEntry,)>>::Output`

For more information about this error, try `rustc --explain E0308`.
```

Ideally the output should explain the lifetime issue somehow rather than saying "one type is more general than the other" for two identical types. I understand that the reason why this code doesn't work is as described in https://stackoverflow.com/questions/47121985/why-cant-i-use-a-key-function-that-returns-a-reference-when-sorting-a-vector-wi but this error output wasn't informative :)
Repository: node
Issue: unhandledRejection unconditionally prevents uncaughtExceptionMonitor
Labels: process

### Version

_No response_

### Platform

_No response_

### Subsystem

process

### What steps will reproduce the bug?

```mjs
process.on('unhandledRejection', (err) => {console.trace('unhandledRejection', err);});
process.on('uncaughtExceptionMonitor', (err) => {console.trace('uncaughtExceptionMonitor', err);});
Promise.reject(new Error('from promise'));
```


### How often does it reproduce? Is there a required condition?

Always

### What is the expected behavior?

There is some way to see the error in `'uncaughtExceptionMonitor'`, throwing inside of `unhandledRejection` converts the type to `uncaughtException` and loses context.

### What do you see instead?

If you register `unhandledRejection` there is no way to get the default behavior of seeing it in `uncaughtExceptionMonitor`, it is completely prevented with no way to opt-out.

### Additional information

_No response_
Repository: pytorch
Issue: Derivative for _ctc_loss_backward
Labels: high priority,module: double backwards,module: autograd,triaged,actionable

### 🚀 The feature, motivation and pitch

Discussion motivation: https://discuss.pytorch.org/t/higher-order-gradients-of-ctcloss/35019

Hi! I'm trying to do double backward for CTC loss function and I can't do it due to `Runtime Error: derivative for _ctc_loss_backward is not implemented` error.

I'm implementing https://arxiv.org/abs/2102.08098 paper for a network with CTC loss. So I can't do it in a natural way with default `torch.nn.functional.ctc_loss`.

GradInit calculates gradient norm and penalizes network for high gradient norms. Code fails in this place:
https://github.com/zhuchen03/gradinit/blob/fdaaab15d796864719b71ae6b358a99aeab3ec17/gradinit_utils.py#L207

### Alternatives

As an alternatives, I'm considering using different losses or hand-written ctc loss realization which are not optimal for our network, so it can cause not optimal optimization process.

### Additional context

_No response_

cc @ezyang @gchanan @zou3519 @bdhirsh @albanD @gqchen @pearu @nikitaved @soulitzer @Lezcano @Varal7
Repository: flutter
Issue: Option to setForceDark on WebView for Android
Labels: c: new feature,platform-android,p: webview,package,c: proposal,P3,team-android,triaged-android

I need to let the WebView honor `prefers-color-scheme` media query. To do that, on Android, one needs to set the following flag:

```
if(WebViewFeature.isFeatureSupported(WebViewFeature.FORCE_DARK)) {
    WebSettingsCompat.setForceDark(myWebView.getSettings(), WebSettingsCompat.FORCE_DARK_ON);
}
```
Is it possibile to add one option to do that?
Repository: next.js
Issue: <next-route-announcer> keeps the document title for the previous page
Labels: Navigation

### What version of Next.js are you using?

12.0.8-canary.6

### What version of Node.js are you using?

v16.13.0

### What browser are you using?

Chrome

### What operating system are you using?

macOS

### How are you deploying your application?

Vercel

### Describe the Bug

After doing a client side page transition, `<next-route-announcer>` keeps the title of the previous page.

### Expected Behavior

It should have the title of the new page as the content.

### To Reproduce

We can simply reproduce this bug on https://nextjs.org by navigating around.
Repository: flutter
Issue: [flutter_tools] pubspec.yaml environment.flutter constraint not respected by pub get
Labels: c: regression,tool,P2,team-tool,triaged-tool

steps to reproduce
1. use current stable version flutter 2.8.1
2. in pubspec.yaml use   flutter: ">=2.8.0 <2.8.1" or  "2.8.0"

Expected behaviour - flutter pub get error 
---
```
The current Flutter SDK version is 2.8.1.

Because app_name requires Flutter SDK version <2.8.1, version solving failed.
```
Actual behaviour: pub get succeeds; vesrion constraint fails, overzealous dev or build server just ugpraded to a newer version of flutter without discussion or any testing at all or possibly even an easy OOTB way to see what version was built with
Repository: godot
Issue: Vulkan: LightmapGI does not take MultiMeshes into account for baking
Labels: bug,topic:rendering,topic:3d

*Related to https://github.com/godotengine/godot/issues/56024 which is for VoxelGI.*

### Godot version

4.0.dev (1cbf3947d)

### System information

Fedora 34, GeForce GTX 1080 (NVIDIA 470.74)

### Issue description

*Similar to https://github.com/godotengine/godot/issues/48909, but with the new lightmap GI implementation in `master`.*

LightmapGI does not take MultiMeshes into account for baking. On the left, you can clearly notice the indirect lighting, but it's completely missing on the right:

Left: Individual MeshInstances, right: MultiMeshInstance:

![2021-12-17_18 09 28](https://user-images.githubusercontent.com/180032/146582345-d3c678fb-3770-4a73-ab6f-f9cc11b814a5.png)



### Steps to reproduce

***Note:** An imported 3D scene with UV2 generated must be used. You cannot use primitive meshes for testing this, as they do not contain a UV2 layer and it can't be generated using the MeshInstance tools. The minimal reproduction project includes a ready-to-use setup for testing this.*

- Import a 3D scene with **Static Lightmaps** bake mode. Click **Advanced** in the import dock, go to the Meshes tab and enable **Save to File**. Specify a path to a `.tres` file to save.
- Add a MeshInstance3D node with the mesh resource loaded to act as a floor. Scale it so it can fit several objects on top. Set the global illumination mode to **Baked** in the inspector.
- Add a MeshInstance3D node with the mesh resource loaded to act as a source mesh for the MultiMesh. Set the global illumination mode to **Baked** in the inspector.
- Add a MultiMeshInstance3D node. Use the menu at the top of the 3D editor viewport to populate the MultiMeshInstance with BoxMeshes.
- Add a LightmapGI, select it and click **Bake** at the top of the 3D editor viewport.

### Minimal reproduction project

[test_lightmapgi_multimesh.zip](https://github.com/user-attachments/files/15974457/test_lightmapgi_multimesh.zip)

<details>
<summary>Old MRPs</summary>

~~[test_lightmapgi_multimesh.zip](https://github.com/godotengine/godot/files/7736682/test_lightmapgi_multimesh.zip)~~

*With `.godot/` included to workaround importing issue:* [test_lightmapgi_multimesh_1.zip](https://github.com/godotengine/godot/files/7777212/test_lightmapgi_multimesh_1.zip)
</details>
Repository: next.js
Issue: Include .wasm files in output trace
Labels: Output (export/standalone)

Currently it is not possible to import `.wasm` files through webpack on serverless functions and have them stay present in the resulting serverless build, it marks the file as having not been found

![image](https://user-images.githubusercontent.com/8385528/142043415-d846ff84-1ba7-4315-907b-88cdbacac586.png)
Repository: pytorch
Issue: channels_last/channels_last_3d memory format not supported for some modules on ROCm that should be supported on CUDA
Labels: module: rocm,triaged,Stale

### 🐛 Describe the bug

 #69317 is adding a test `test_memory_format` to `test/test_modules.py` to determine whether outputs are valid and in the correct memory format when the inputs and modules are converted to various memory formats. However, for `dtype=float32` on the CI ROCm cuda test, the following modules do not produce the expected behavior:

- Batchnorm2d
- Batchnorm3d
- Conv2d
- Conv3d
- ConvTransponse2d

i.e. when either input.to(memory_format=torch.channels_last) (or torch.channels_last_3d where relevant) (or module.to(memory_format=torch.channels_last) when the module has state) the assert output.is_contiguous(memory_format=torch.channels_last) fails

logs here: https://ci.pytorch.org/jenkins/job/pytorch-builds/job/pytorch-linux-bionic-rocm4.3.1-py3.6-test1/14485/console

### Versions

ROCm CI

cc @jeffdaily @sunway513 @jithunnair-amd @ROCmSupport @KyleCZH @jbschlosser
Repository: pytorch
Issue: API to support combined activation offloading or checkpointing
Labels: oncall: distributed,module: autograd,triaged,module: ddp,module: fsdp

### 🚀 The feature, motivation and pitch

2 techniques commonly used to reduce GPU memory footprint are checkpointing of activations within an nn.Module, and offloading intermediate activations between successively checkpointing modules to CPU so that they are not stored on GPU.

With [https://pytorch.org/docs/master/autograd.html?highlight=saved_tensors_hooks#torch.autograd.graph.saved_tensors_hooks](saved tensor hooks), we can implement both of these features, but these hooks also enable us to take a more "intelligent" approach to combine these 2 techniques.

Concretely, given a tensor `x`, we could define some custom logic (or a user-provided lambda) to determine whether `x` should be checkpointed (discarded and recomputed in backward pass), or offloaded to CPU. 

Concretely, this could look something like:

```
def pack(x):
    if should_offload(x):
        return (True, x.device, x.to("cpu"))
    return (False, index(x))

def unpack(x):
    offloaded = x[0]
    if offloaded:
        x = x[2].to(x[1])
    else:
         return storage[x[1]]
```

Additional discussion is needed as to how to determine whether `x` should be checkpointed or offloaded. It is possible that the tensor is not enough information and we may need access to the module that produced `x` (i.e. if it is expensive to recompute, we may want to offload it, if tensor is very large but fast to recompute, we might want to checkpoint it). 

### Alternatives

_No response_

### Additional context

_No response_

cc @mrshenli @pritamdamania87 @zhaojuanmao @satgera @gqchen @aazzolini @osalpekar @jiayisuse @H-Huang @kwen2501 @awgu @ezyang @albanD @zou3519 @pearu @nikitaved @soulitzer @Lezcano @Varal7 @pietern @rohan-varma @SciPioneer
Repository: pytorch
Issue: build_ios.sh prevents iOS.cmake from configuring ios deployment target correctly
Labels: module: build,triaged,module: ios,Stale

### 🐛 Describe the bug

 It seems to me that ./scripts/build_ios.sh ends up preventing ./cmake/iOS.cmake setting minimum deployment target correctly. 

Running
./scripts/build_ios.sh -DIOS_DEPLOYMENT_TARGET=13.0 
should end up setting
CMAKE_CXX_FLAGS:STRING=-miphoneos-version-min=13.0 -fvisibility-inlines-hidden
in CMakeCache.txt, but instead there is:
CMAKE_CXX_FLAGS:STRING=-fobjc-arc

The reason are the following lines in build_ios.sh:
```
# enable ARC
CMAKE_ARGS+=("-DCMAKE_CXX_FLAGS=-fobjc-arc")
```
which forces CMAKE_CXX_FLAGS to override the CMAKE_CXX_FLAG_INIT during first evaluation of iOS.cmake, thus leading it to not write the desired 

CMAKE_CXX_FLAGS:STRING=-miphoneos-version-min=13.0 -fvisibility-inlines-hidden

line to CMakeCache.txt

This can be worked around by running ./scripts/build_ios.sh -UCMAKE_CXX_FLAGS -DIOS_DEPLOYMENT_TARGET=13.0

but this is sub-optimal. I believe the correct behaviour could be achieved by build_ios.sh setting CXXFLAGS environment variable for cmake invocation instead of passing -DCMAKE_CXX_FLAGS (see https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_FLAGS_INIT.html). That would allow combining the flags set by build_ios.sh with those from iOS.cmake.

### Versions

This is the behaviour with fairly recent (2021-12-12) commit af7ee9fc0193170f89df5627d27b9201f45df77b

cc @malfet @seemethere
Repository: PowerToys
Issue: Move windows 'shown on all desktops' to their virtual desktop-specific zones
Labels: Idea-Enhancement,Product-FancyZones,FancyZones-VirtualDesktop

### Description of the new feature / enhancement

Hello,

_I am not 100% sure whether this should be working and isn't, or if this is something that could be added._ 

**When making a window/app shared across all desktops it would be nice if the window/app could have zones saved on a per virtual desktop basis.**

### Scenario when this would be used?

I use virtual desktops as a way of having multiple workspaces. Some of those workspaces do share some apps in common, yet I may wish/need to use a slightly different zone layout.

I would expect to be able to assign an app to one of the zones of the virtual desktop & be update/restored when cycling between virtual desktops which may have the app assigned to a different zone entirely.

### Supporting information

_No response_
Repository: godot
Issue: Stylebox "Content Margin" does nothing for ItemLists
Labels: bug,topic:gui

### Godot version

3.4.1 Stable

### System information

Windows 10

### Issue description

I noticed that when I add a StyleBox to a control like a ItemList, the Content Margin doesn't work as I would expect.
If I change the top and left, it will seemingly move the internal items as expected.
![Untitled-1](https://user-images.githubusercontent.com/26915986/146630340-67525937-5cb1-4e41-8acf-b1f35f46c00a.png)

For instants, I create a ItemList and add a background StyleBoxFlat.  I add a content margin of 10 to each side.  Just for refence I also add a border 10 pixels wide: 

In this picture it looks like it works, keeping the content of the Items within the Content Margins.  However, if you add more items or resize the ItemList, you will see that the Content Margin isn't really working for Bottom or Right.  Notice how it is bleeding on the bottom and right:
![Untitled-2](https://user-images.githubusercontent.com/26915986/146630368-38fbee47-c180-4be0-9ecf-dae9607548e5.png)
![Untitled-3](https://user-images.githubusercontent.com/26915986/146630374-57c81b24-72cf-4066-bdea-580fdb79c4b7.png)

Furthermore, if you run the program and scroll down, it will bleed on the top as well:
![Untitled-4](https://user-images.githubusercontent.com/26915986/146630385-bc1f0e39-c652-44da-9601-cd8ee9baae9b.png)

The potential for the StyleBox is great.  If it worked as expected, you could easily create nice frames or borders around the ItemList and keep its content inside the Content Margins.

BTW, I have also tried to create this look by giving a positive number to Extended Margins, but the Extension just gets clipped.


### Steps to reproduce

add a StyleBox to a control like a ItemList,
make content margin 10 for all.
resize the node to notice how content bleeds.

### Minimal reproduction project

Here is a project to test and play with
[ContentMargins.zip](https://github.com/godotengine/godot/files/7738786/ContentMargins.zip)
.
Repository: yt-dlp
Issue: [Feature request] Show native progress for aria2c
Labels: enhancement,core:downloader

### Checklist

- [X] I'm asking a question and not reporting a bug/feature request
- [X] I've looked through the [README](https://github.com/yt-dlp/yt-dlp#readme)
- [X] I've read the [guidelines for opening an issue](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#opening-an-issue)
- [X] I've searched the [bugtracker](https://github.com/yt-dlp/yt-dlp/issues?q=) for similar questions including closed ones

### Question

How do I capture the percentage download when use aria2c as external downloader ?