sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: pytorch
Issue: [discussion] torch.flatten to allow unsqueeze of inexisting dimension
Labels: triaged,module: batching

### 🚀 The feature, motivation and pitch

E.g. for handling batched and non-batched *CHW tensors uniformly the following idiom may be useful:

`return some_work(tensor.flatten(end_dim = -4)).reshape_as(tensor)`

Currently for 3-dim tensors this breaks, because dimension -4 doesn't exist. It may make sense to support such case to avoid conditional unsqueezes in user code.

### Alternatives

_No response_

### Additional context

_No response_
Repository: flutter
Issue: `flutter build apk --split-per-abi` does not report all the generated APKs
Labels: platform-android,tool,has reproducible steps,P2,found in release: 2.8,found in release: 2.9,team-android,triaged-android

The tool apparently falsely reports the results of `flutter build apk --split-per-abi`.
Luckily it's only the reporting that is wrong, and not the tool itself.

## Steps to Reproduce

1. `flutter create myapp`
2. Disconnect any connected Android device
(not sure if this has any effect, I initially thought it had something to do with it)
3. `flutter build apk --split-per-abi`

**Expected results:** The tool generates _and reports_ correctly that the APK's have been generated.

**Actual results:** The tool only reports one APK being generated (even though all APK's have been built)

<details>
  <summary>Logs</summary>

```
navaronbracke@MacBook-Pro-van-Navaron myapp % flutter build apk --split-per-abi

💪 Building with sound null safety 💪

Running Gradle task 'assembleRelease'...                           63.0s
✓  Built build/app/outputs/flutter-apk/app-armeabi-v7a-release.apk (31.5MB).
```

```
cd build/app/outputs/flutter-apk && ls -a
.                               app-arm64-v8a-release.apk       app-x86_64-release.apk          app.apk.sha1
..                              app-armeabi-v7a-release.apk     app.apk
```

**Doctor output**

```
[✓] Flutter (Channel stable, 2.8.1, on macOS 12.0.1 21A559 darwin-x64, locale en-BE)
    • Flutter version 2.8.1 at /Users/navaronbracke/Documents/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 77d935af4d (5 weeks ago), 2021-12-16 08:37:33 -0800
    • Engine revision 890a5fca2e
    • Dart version 2.15.1

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/navaronbracke/Library/Android/sdk
    • Platform android-31, build-tools 30.0.3
    • ANDROID_HOME = /Users/navaronbracke/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.10.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2020.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)

[✓] VS Code (version 1.63.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.32.0

[✓] Connected device (1 available)
    • Chrome (web) • chrome • web-javascript • Google Chrome 97.0.4692.71

• No issues found!
```

</details>
Repository: pytorch
Issue: [feature request] [discussion] Generalize / recommend behavior of reset_parameters (and potentially rename)
Labels: module: nn,triaged,module: fx

### 🚀 The feature, motivation and pitch

It seems that FX isn't playing nice with any instance methods except forward: https://github.com/pytorch/vision/pull/5197#discussion_r786695774. It prevented factoring out initialization into a separate method, and it also seems to trigger consideration of review / retiring existing reset_parameters methods for torchvision models as they don't play nice with FX.

This also seems to prevent reset_parameters being supported, as additional instance methods will not work after FX (?)

Methods of this kind exist in practically all models, but have different names: `reset_parameters`, `_reset_parameters`, `_init_parameters` etc

Related issues: https://github.com/pytorch/vision/issues/3410, https://github.com/pytorch/pytorch/issues/66335

Periodically reinitializing parts of model is useful in some training scenarios, as it can prevent overfitting (e.g. used in http://cvlab.postech.ac.kr/~jeany/ACCV2018_forget_and_diversify.pdf) and being able to do it inplace is nice as it saves memory and potentially heavy constructor calls. It's also nice for having this init code in separate methods for preventing time-consuming code navigation and copy-pasting of it (in majority of scenarios when FX isn't used)

Another times, this is useful to do as workaround for bugs like this: https://github.com/pytorch/pytorch/issues/72253

### Alternatives

_No response_

### Additional context

cc @albanD @mruberry @jbschlosser @walterddr @kshitij12345 @saketh-are @ezyang
Repository: rust
Issue: The size of `(T, Infallible)` is not zero
Labels: C-enhancement

Since `Infallible` is an [empty type](https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types), I expect `(T, Infallible)` also be an empty type, thus they should have the same size. But I noticed that `(T, Infallible)` have the same size as `T`, so currently, we have

- `mem::size_of::<Option<Infallible>>() == 0`
- `mem::size_of::<Option<(u32, Infallible)>>() = 8`

I guess this is because Rust treats empty type to have size 0, so the size of `(T, Infallible)` is size of `T` plus size of `Infallible` equals size of `T`. May be we can use something like `Option<usize>` to represent the size of a type internally, where `None` means the size of an empty type, in this way, we can distinguish empty types from zero sized types. For example, internally, we can have a function like:

```rust
fn internal_size_of<T>() -> Option<usize> { ... }
```

To keep the current behavior of `mem::size_of`, it can be implemented as:

```rust
fn size_of<T>() {
    internal_size_of::<T>().unwrap_or(0)
}
```
Repository: PowerToys
Issue: Power Rename lacks the features of premium rename tools 
Labels: Product-PowerRename,Needs-Triage,Needs-Team-Response

### Description of the new feature / enhancement

the toolset offered in directory opus advanced rename

### Scenario when this would be used?

being a power user does not equate to rolling regular expressions in your head.

so the scenario is everyone who say has tens of thousands of still images to composite and needs them renamed precisely and who isn't john carmack.

### Supporting information

if I have to learn regular expressions might as well just do it in bash.
Repository: vscode
Issue: Multiple line commenting does not work for languages like XML/HTML
Labels: feature-request,editor-comments

<!-- ⚠️⚠️ Do Not Delete This! bug_report_template ⚠️⚠️ -->
<!-- Please read our Rules of Conduct: https://opensource.microsoft.com/codeofconduct/ -->
<!-- 🕮 Read our guide about submitting issues: https://github.com/microsoft/vscode/wiki/Submitting-Bugs-and-Suggestions -->
<!-- 🔎 Search existing issues to avoid creating duplicates. -->
<!-- 🧪 Test using the latest Insiders build to see if your issue has already been fixed: https://code.visualstudio.com/insiders/ -->
<!-- 💡 Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. -->
<!-- 🔧 Launch with `code --disable-extensions` to check. -->
Does this issue occur when all extensions are disabled?: Yes

<!-- 🪓 If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. -->
<!-- 📣 Issues caused by an extension need to be reported directly to the extension publisher. The 'Help > Report Issue' dialog can assist with this. -->
- VS Code Version: 1.63.2
- OS Version: Ubuntu 20.04.3 LTS (OS doesn't matter)

Steps to Reproduce:

1. Open an XML/HTML file
2. Select multiple lines
3. Use "Add Line Comment" or "Toggle Line Comment" function
Expected: Each selected line is commented separately. (line comment)
Actual: Block comment happens.

This is duplicate of https://github.com/microsoft/vscode/issues/35464 which was closed by [bettercomment extension](https://marketplace.visualstudio.com/items?itemName=Gruntfuggly.bettercomment) solution. I wanted to revive this issue because I think this issue shouldn't be solved by an extension. This is a core function in my humble opinion.
Repository: PowerToys
Issue: Awake: option to automatically stop awake when the computer is manually locked
Labels: Idea-Enhancement,Product-Awake

### Description of the new feature / enhancement

While at work, if I walk away from my computer, I manually lock it with the Win+L shortcut. I'd like it if that also switched Awake off so that the screen can go to sleep. Then of course it should remember it did that, and turn itself back on when I unlock.

### Scenario when this would be used?

When leaving my computer unattended in the office or a public place, so I can go to the bathroom or get a coffee, and the screen will turn off and be environmentally friendly.

### Supporting information

Related: #12661 — also about an easy way to toggle it, having a shortcut is a good workaround that could be use instead of this, on the other hand turning off on lock is probably a good chunk of the use case in practice, and some users might be happy enough with locking the screen when they want to allow sleep
Repository: storybook
Issue: recommended Template.bind story notation does not work with storysource addon
Labels: bug,needs triage

**Describe the bug**
In a typescript project the recommended Template.bind notation in stories does not work.. it only says: `loading source...`

**To Reproduce**
I created a reproduction repo with create react app here: https://github.com/7yp0/storybook-storysource-bug
There are two copies of the same component  (color-button and color-button2) each with different notation in the story. When you start you will see that color-button2 has the described bug.

**System**
  OS: Linux 5.10 Ubuntu 20.04.3 LTS (Focal Fossa)
  CPU: (16) x64 AMD Ryzen 7 PRO 4750U with Radeon Graphics
Binaries:
  Node: 16.13.2 - /usr/bin/node
  Yarn: 1.22.17 - /usr/bin/yarn
  npm: 8.1.2 - /usr/bin/npm
npmPackages:
  @storybook/addon-storysource: ^6.4.13 => 6.4.13
  @storybook/react: ^6.4.13 => 6.4.13     

**Additional context**
Add any other context about the problem here.
Repository: create-react-app
Issue: .env vars empty in .env.development
Labels: needs triage,issue: bug report

### Describe the bug

The environmental variables defined in `.env` file cannot be used in `.env.development` and `.env.production` files.

### Steps to reproduce

1. define .env variable:
```
PORT=4000
```

2. define .env.development variable:
```
REACT_APP_URL=http://localhost:${PORT}
```

3. Add code showing the value
```
console.log(process.env.REACT_APP_URL);
```

4. Run the app and see the value

The result is: "http://localhost:" - the port is missing.

If the port is defined in the same file .env.development:
```
PORT=4000
REACT_APP_URL=http://localhost:${PORT}
```
Then the result is correct: "http://localhost:4000".
Repository: vscode
Issue: explorer.sortOrder default doesn't work well for hashes
Labels: help wanted,feature-request,file-explorer

![image](https://user-images.githubusercontent.com/2193314/149966247-64c49fb0-0973-4457-9202-45b62275cc20.png)

With this folder https://github.com/lunapaint/imagetestsuite/tree/main/png, it starts off alphabetical but gives up shortly after. It looks like the it's sorting by the number first such that 3, 20, 100 appear in the "correct" order. I suggest making one of the following changes:

- Only use that rule when the file name excluding the extension is a number (not sure what cases are being covered)
- Add a setting for actual alphabetical sorting
- My preference: Sort alphabetical if the file name looks like a hash (/[0-9a-f]{7,32}/)

Have been hitting this a decent amount recently, instead of a quick find via visual check I need to type out the first part of the hash to filter the explorer.

![image](https://user-images.githubusercontent.com/2193314/149966316-c55f0acc-fccc-4415-b733-81aa2707a3c3.png)
Repository: pytorch
Issue: Push to fork failed with cryptic "refusing to allow a Personal Access Token to create or update workflow `.github/workflows/run_torchbench.yml` without `workflow` scope"
Labels: module: ci,triaged

### 🐛 Describe the bug

Want to update the PR, but I can't  as push fails with 
```
% git push --force
Enumerating objects: 7, done.
Counting objects: 100% (7/7), done.
Delta compression using up to 8 threads
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 988 bytes | 494.00 KiB/s, done.
Total 4 (delta 3), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (3/3), completed with 3 local objects.
To https://github.com/malfet/pytorch
 ! [remote rejected]       malfet/lazy-import-pkg_resources -> malfet/lazy-import-pkg_resources (refusing to allow a Personal Access Token to create or update workflow `.github/workflows/run_torchbench.yml` without `workflow` scope)
error: failed to push some refs to 'https://github.com/malfet/pytorch'
```

### Versions

NA

cc @seemethere @malfet @pytorch/pytorch-dev-infra
Repository: terminal
Issue: The Terminal needs a commandline argument to open the window elevated
Labels: Product-Terminal,Issue-Task,Area-Commandline

This is the formal tracking for the follow up to #12142. There, I tried making the arg `wt new-tab --elevate`, and that's riddled with edge cases. It should be `wt --elevate new-tab`
Repository: godot
Issue: Vulkan: CameraAttributes depth of field amount is resolution-dependent
Labels: bug,topic:rendering,topic:3d

*Related to https://github.com/godotengine/godot/issues/54518.*

### Godot version

4.0.dev (ce6de717f)

### System information

Fedora 34, GeForce GTX 1080 (NVIDIA 495.46)

### Issue description

The DoF effect's amount is resolution-dependent. This means the depth of field will appear to be *stronger* as the rendering resolution decreases. This happens regardless of the depth of field bokeh shape and quality selected in the Project Settings.

This means the rendering will change in unintended ways depending on the user's monitor resolution. Also, if we implement dynamic resolution scaling and [FSR](https://github.com/godotengine/godot-proposals/issues/2809) in the future, we need to make sure every effect is as a resolution-independent as possible.

https://user-images.githubusercontent.com/180032/149983514-1ea30fa8-9640-4139-b143-19e56a2597ce.mp4

### Steps to reproduce

- Add a Camera3D node with a CameraEffects resource.
- Enable Dof Far and Dof Near on the CameraEffects resource.
- Create a MeshInstance with a SphereMesh. Move the SphereMesh away from the camera so the depth of field can be visible from the Camera3D preview.
- Add a StandardMaterial3D on the SphereMesh, with a bright albedo and/or emission value (to make depth of field visible).
- Decrease the 3D resolution scale factor at run-time using `get_viewport().scale_3d -= 0.1`.

### Minimal reproduction project

https://github.com/Calinou/test_fxaa_supersample_master
Press the <kbd>Up</kbd> / <kbd>Down</kbd> arrow keys to adjust the 3D rendering scale. When doing so, watch the depth of field become stronger as the resolution decreases.
Repository: opencv
Issue: Correct averaging of colors
Labels: question (invalid tracker)

The fact that averaging vectors in [sRGB color space][1] doesn't yield perceptually nice results is hinted at in [the video "Computer color is broken"][2] and in [Wikipedia's explanation of the sRGB transfer function][3].

Does [`resize()`][4] make this mistake when interpolating colors (combining several colors into one pixel when downscaling and interpolating new intermediate pixels when upscaling)?

If it interpolates colors correctly, where in the code does it apply the transfer function? The problem is that the documentation doesn't say so.

If it interpolates colors wrong, I wonder what transfer functions I should apply (in Python code) to the image **before and after** `resize()` for better color averaging ([`colour.models.eotf_sRGB`](https://colour.readthedocs.io/en/develop/generated/colour.models.eotf_sRGB.html#colour.models.eotf_sRGB) before and [`colour.models.eotf_inverse_sRGB`](https://colour.readthedocs.io/en/develop/generated/colour.models.eotf_inverse_sRGB.html#colour.models.eotf_inverse_sRGB) after or the other way around or something else), and whether that would be perfect or only an approximation (similarly to how [gamma correction with gamma=2.2 is only an approximation of the sRGB transfer function][3]).

The documentation of `resize()` should mention it and maybe do it (depending on additional input arguments).

In general, does OpenCV assume the sRGB color space in such cases where the color space influences the results? Maybe the documentation should mention that.


  [1]: https://en.wikipedia.org/wiki/SRGB
  [2]: https://www.youtube.com/watch?v=LKnqECcg6Gw
  [3]: https://en.wikipedia.org/wiki/SRGB#Transfer_function_(%22gamma%22)
  [4]: https://docs.opencv.org/4.5.5/da/d54/group__imgproc__transform.html#ga47a974309e9102f5f08231edc7e7529d
Repository: TypeScript
Issue: Apparent type of unknown when strictNullChecks=false causes odd errors on property access
Labels: Suggestion,Experience Enhancement

When `strictNullChecks` is disabled (as in JS code), destructuring a variable of type `unknown` produces the message:

```
Property 'foo' does not exist on type '{}'.(2339)
```

Whereas with it enabled, the error is:

```
Property 'foo' does not exist on type 'unknown'.(2339)
```

This behavior isn't actually tested anywhere, and was revealed in #47442.

When assigning `unknown` to a variable of some class type with properties, a similar error is produced:

```
Property 'prop' is missing in type '{}' but required in type 'A'.(2741)
```

Whereas `strictNullChecks = true` produces a more obvious error:

```
Type 'unknown' is not assignable to type 'A'.(2322)
```

This behavior (and other errors like it) is actually captured in a few tests.

This all seems to stem from the fact that `getApparentType` returns the empty object type as `unknown`'s apparent type, which was added in #30637.

I would personally argue that the latter errors in the above examples make more sense than referring to `{}`, which doesn't actually appear in the code anywhere. Right now, this doesn't seem to be very visible (as people in JS are unlikely to see `unknown`), but with #47383 / #47442, this may become more visible.

```ts
const { foo } = {} as unknown;

function func({ foo }: unknown) {}

try {} catch ({ foo }) {}


class A {
    prop: number;
}

const a: A = {} as unknown;
```

[Playground Link](https://www.typescriptlang.org/play?strict=false&strictNullChecks=false&jsx=0&ts=4.5.4&filetype=ts#code/MYewdgzgLgBA3jAZiEMC+MC88MEMIwCuYA1mCAO5gDcAULYscFAJbhJMAUCyqaAXEVLkqAShz0oAJwCeOGMFxRgACxjckKdOLhp6tYABt8BAILxaMKzAAOUkDcFhCAWwBGAUyl09B8NBhcQXNsXUCCYjJKGiA)


Split off from https://github.com/microsoft/TypeScript/pull/47442#discussion_r785197785.
Repository: pytorch
Issue: Discussion of TorchQuantum and QuantumNAS
Labels: triaged,module: complex,complex_autograd

### 🚀 The feature, motivation and pitch

discussion of support for quantum gates for quantum neural networks, similar to https://github.com/mit-han-lab/torchquantum 

### Alternatives

_No response_

### Additional context

_No response_

cc @ezyang @anjali411 @dylanbespalko @mruberry @Lezcano @nikitaved
Repository: angular
Issue: Feature Request: Improve error messages regarding animation-related attributes on special elements
Labels: feature,area: animations,feature: in backlog

### Which @angular/* package(s) are relevant/releated to the feature request?

animations, compiler, core

### Description

### Feature

This issue is for taking into consideration improving the error messages for the case when animation-related attributes (as far as I can tell those only include triggers and `@.disabled`) are used on special elements (`<ng-template>`, `<ng-content>` or `<ng-container>`).

This probably needs to be added in the template type-checking subsystem as well as to the runtime (under ngDevMode, so it's tree-shaken away in prod bundles).

___

### Explanation:

For example see here:
![145676817-e91f2aff-14a5-4c5f-86b6-4a59511f0a21](https://user-images.githubusercontent.com/61631103/150013632-7e2e1e4a-3eec-4207-bc65-d133cf6998b1.png)

We only get runtime errors in the console saying that the animation attributes are not know properties of `ng-template`/`ng-container` the suggestion here is provide more useful error messages prompting the user not to use animation-related attributes for special elements since the attributes will not take effect for such elements

___

### Current Behavior

We get the aforementioned runtime errors in the console but the application runs without issues (naturally no animation is applied to the special-elements), the application also gets built without issues.


### New Proposed Behavior

Provide new warnings for this issues during the compilation of the application (both during development and builds) and also improve the existing runtime errors to provide more useful information to the users.

(Alternatively we could make the compilation fail as it encounters such cases, but that may be a bit too much I'd imagine)

Possibly we could also only just update the errors to be more specific as that is also consistent with the animations errors, for example when an animation trigger hasn't been registered, nothing breaks but simple a console error is presented to the user:
![Screenshot at 2022-01-18 20-54-03](https://user-images.githubusercontent.com/61631103/150017129-72b9ddd0-778c-458b-bdad-6495d3ab1ab6.png)
ensuring the same sort of behavior here could be good for consistency and it would also not cause any breaking of current functionalities (note: the console error appears both locally and in production builds).

___

### Extra

The issue relates to the special elements but I am wondering if other elements could/should be included as well, for example I am thinking of `router-outlet` it isn't technically wrong to put a trigger on it, but since it is only a placeholder I am wondering if we should at least warn the user about it (for example if they may think that animating the `router-outlet` can have an effect on the routed components)

___

Original conversation: https://github.com/angular/angular/pull/44378#discussion_r768286077