sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: pytorch
Issue: Inconsistent Keyword Arguments behaviors in torch.triangular_solve()
Labels: triaged,module: linear algebra,topic: deprecation,topic: docs,module: python frontend

### 🐛 Describe the bug

I encountered unexpected behavior and a documentation inconsistency when using torch.triangular_solve(). The documentation mentions that the function takes arguments 'A' and 'b', but when providing these as keyword arguments, an error message states that "input" is also required. Additionally, the function throws a runtime error related to tensor dimensions.

To reproduce :
```python
import torch

args = {'A': torch.randn([1]), 'b': torch.randn([2])}
res = torch.triangular_solve(**args)
```
it returns
```
TypeError: triangular_solve() missing 2 required positional argument: "input", "A"
```

Second case: using 'A' and 'input'
```python
import torch
args = {'A': torch.randn([1]), 'input': torch.randn([2])}
res = torch.triangular_solve(**args)
```

Error message:

```
RuntimeError: torch.triangular_solve: Expected to have at least 2 dimensions, but it has 1 dimensions instead
```
Expected Behavior:

I expected the code to work based on the keyword arguments 'A' and 'b' as per the documentation.

Actual Behavior:

The code throws a TypeError and a RuntimeError related to missing or incorrect arguments.


### Versions

PyTorch Version: 2.2.0.dev20231023+cu118

cc @jianyuh @nikitaved @pearu @mruberry @walterddr @xwang233 @Lezcano @albanD
Repository: opencv
Issue: Use static thread_local instead of a function scope static variables in oclCvtColorBGR2HSV (color_hsv.dispatch.cpp)
Labels: bug,category: imgproc,category: ocl

### System Information

OpenCV version: 4.8.0
Operating System / Platform: openSUSE Tumbleweed (VERSION_ID="20231008")
Compiler & compiler version: gcc (SUSE Linux) 13.1.1 20230710 [revision f9781fcf733ca3afe5b5811afd8ecbb18d9d3a11]





### Detailed description

Inside the function oclCvtColorBGR2HSV ([color_hsv.dispatch.cpp](https://github.com/opencv/opencv/blob/1fe0fc224ce3a33b2a92627f594065c7c390bbf5/modules/imgproc/src/color_hsv.dispatch.cpp#L277-L283)) variables are defined as static so that they are initialized only once. That can lead to race conditions and OpenCL-context conflicts. Instead of ```static``` these variables should be declared ```static thead_local```;

### Steps to reproduce

```c++
#include <opencv2/core.hpp>
#include <opencv2/imgproc.hpp>
#include <thread>
int main() {
	std::thread t([](){
		cv::UMat src(cv::Size(1280, 720), CV_8UC3);
		cv::UMat dst;
		while(true) {
			cvtColor(src, dst, cv::COLOR_BGR2HSV);
		}
	});

	cv::UMat src(cv::Size(1280, 720), CV_8UC3);
	cv::UMat dst;

	while(true) {
		cvtColor(src, dst, cv::COLOR_BGR2HSV);
	}
}
```

### Issue submission checklist

- [X] I report the issue, it's not a question
- [X] I checked the problem with documentation, FAQ, open issues, forum.opencv.org, Stack Overflow, etc and have not found any solution
- [X] I updated to the latest OpenCV version and the issue is still there
- [X] There is reproducer code and related data files (videos, images, onnx, etc)
Repository: go
Issue: testing/fstest: TestFS: relax check ReadDir based on perms
Labels: NeedsInvestigation

## TL;DR

Drop one false positive case in [`testing/fstest.TestFS`](https://pkg.go.dev/testing/fstest#TestFS): it is ok for [`ReadDir`](https://pkg.go.dev/io/fs#FS.ReadDirFS) to return [`ErrPermission`](https://pkg.go.dev/io/fs#ErrPermission) if the [`fs.FileMode`](https://pkg.go.dev/io/fs#FileMode) of the [file](https://pkg.go.dev/io/fs#File) says some users are not allowed to read the directory.

## Context

With [`io/fs.FS`](https://pkg.go.dev/io/fs#FS), there is no way to select which permission bits ([`fs.FileMode`](https://pkg.go.dev/io/fs#FileMode)) apply when [reading a file](https://pkg.go.dev/io/fs#ReadFileFS). So fstest.TestFS has no way to enforce that given a FileMode's file/directory based on user/group/others permission bits, `Open`, [`ReadFile`](https://pkg.go.dev/io/fs#ReadFileFS) or [`ReadDir`](https://pkg.go.dev/io/fs#ReadDirFS) should trigger or not an [`fs.ErrPermission`](https://pkg.go.dev/io/fs#ErrPermission).

Currently any error (including [`ErrPermission`](https://pkg.go.dev/io/fs#ErrPermission)) on [`ReadDir`](https://pkg.go.dev/io/fs#FS.ReadDirFS) is always considered an error. However returning `fs.ErrPermission` is correct behaviour if the filesystem enforces `fs.FileMode` and the directory has read permissions bits off.

## Proposal

I propose that `TestFS` to ignore `ErrPermission` on [`ReadDir`](https://pkg.go.dev/io/fs#FS.ReadDirFS) if at least one *read* permission bit is not set: ignore `ErrPermission` (and silently skip other `ReadDir` checks) if `mode & 0444 != 0444`.

## Impact

This change will only drop some returned errors and will never raise more errors, so backward compatibility is preserved.
Repository: next.js
Issue: External library code gets loaded on blank page where library is not used
Labels: bug,Navigation

### Link to the code that reproduces this issue

https://github.com/smitbarmase/webpack-bundle-bug

### To Reproduce

1. Build the application (next build)
2. Start the application (next start)
3. Notice `swiper` is only used on `/` page and not on `/about-us`.
4. Open network tab, navigate to `/about-us`, search for `swiper` keyword in chunks.
5. Hard refresh `/about-us` multiple times, you will see `swiper` chunks still getting downloaded.

* Turn off cache in network tab if not able to reproduce *

Screenshot of network tab of `/about-us` after searching `swiper` in chunks:
<img width="1248" alt="image" src="https://github.com/vercel/next.js/assets/37347831/816fdef3-c4d8-43b2-a348-5e18f26a888f">




### Current vs. Expected behavior

Currently, `swiper` chunks getting downloaded on `/about-us` page, which is empty.

Expected behavior would be `swiper` chunks gets downloaded only on home page `/` as `swiper` is used only on that page.

### Verify canary release

- [X] I verified that the issue exists in the latest Next.js canary release

### Provide environment information

```bash
Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 23.0.0: Fri Sep 15 14:41:43 PDT 2023; root:xnu-10002.1.13~1/RELEASE_ARM64_T6000
Binaries:
  Node: 20.6.1
  npm: 9.8.1
  Yarn: N/A
  pnpm: 8.7.1
Relevant Packages:
  next: 13.5.7-canary.23
  eslint-config-next: N/A
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5.1.3
Next.js Config:
  output: N/A
```


### Which area(s) are affected? (Select all that apply)

App Router, Routing (next/router, next/navigation, next/link)

### Additional context

_No response_
Repository: material-ui
Issue: [material-next][Select] Refactor Select component to use Base UI's hooks
Labels: on hold,component: select,package: material-ui

Refactor Select component to use Base UI's `useSelect` and `useOption` hooks without significant braking changes.
Repository: angular
Issue: feature(service-worker): Store received notifications
Labels: area: service-worker

### Which @angular/* package(s) are relevant/related to the feature request?

service-worker

### Description

If I'm not mistaken the current service worker only displays / reacts on incoming notifications. There is no chance to list them afterwards.

Since many users accidentally click them away / want to check them later, I'd like to be able to access old received notifcations.

### Proposed solution

Received messages could be stored to localStorage. The key and the maximum latest message store count could be set, so with a default value of zero the current SW even wouldn't behave any different.

### Alternatives considered

-
Repository: pytorch
Issue: [opcheck] Cannot share failures_dict between multiple tests with differing sets of tests they run 
Labels: triaged,module: opcheck

### 🐛 Describe the bug

The validation code tests that all keys are valid for every test, which means that if you have one test set with less running tests than another, that test will fail that the json is malformed because it sees test keys it doesn't recognize

### Versions

main

cc @zou3519
Repository: rust
Issue: Sub-optimal code-gen for branchless pointer increment
Labels: A-LLVM,I-slow,C-bug

A common idiom in branchless (jumpless) code is to either increment a pointer by 0 or 1 which can be derived from a bool. The obvious way to do this is `ptr = ptr.add(bool_val as usize)` however doing so results in slightly sub-optimal code-gen on both x86_64 and Arm.

A minimal example:

```rust
pub unsafe fn inc_direct(v: &[u64], mut side_effect_out: *mut *const u64) {
    for elem in v {
        let cond = *elem < 30;
        *side_effect_out = elem;
        side_effect_out = side_effect_out.add(cond as usize);
    }
}
```

Generated machine-code for the loop:

x86_64

```asm
.LBB0_2:
        xor     eax, eax
        cmp     qword ptr [rdi], 30
        mov     qword ptr [rdx], rdi
        lea     rdi, [rdi + 8]
        setb    al
        lea     rdx, [rdx + 8*rax]
        add     rsi, -8
        jne     .LBB0_2
```

Arm

```asm
.LBB0_2:
        ldr     x10, [x9], #8
        str     x0, [x2]
        mov     x0, x9
        cmp     x10, #30
        cset    w10, lo
        subs    x8, x8, #8
        add     x2, x2, w10, uxtw #3
        b.ne    .LBB0_2
```

Notably, on x86_64 the use of xor + setb + lea. And cset on Arm.

Compared to a version using an additional counter with `counter += cond as usize;`

```rust
pub unsafe fn inc_via_counter(v: &[u64], mut side_effect_out: *mut *const u64) {
    let mut cond_count = 0;
    for elem in v {
        let cond = *elem < 30;
        *(side_effect_out.add(cond_count)) = elem;
        cond_count += cond as usize;
    }
}
```

Generated machine-code for the loop:

x86_64

```asm
.LBB1_2:
        cmp     qword ptr [rdi], 30
        mov     qword ptr [rdx + 8*rax], rdi
        lea     rdi, [rdi + 8]
        adc     rax, 0
        add     rsi, -8
        jne     .LBB1_2
```

Arm

```asm
.LBB1_2:
        ldr     x11, [x10], #8
        str     x0, [x2, x8, lsl #3]
        mov     x0, x10
        cmp     x11, #30
        cinc    x8, x8, lo
        subs    x9, x9, #8
        b.ne    .LBB1_2
```

Notably the use of adc on x86_64 and cinc on Arm. Using uica and LLVM to simulate the performance of the respective loops we get:

inc_direct cycles per loop iteration:

Tool | Skylake | Sunny Cove
-----|----------|-------------
uiCA | 2.01      | 1.87
llvm-mca | 1.59 | 1.59

inc_via_counter cycles per loop iteration:

Tool | Skylake | Sunny Cove
-----|----------|-------------
uiCA | 1.31      | 1.56
llvm-mca | 1.33 | 1.33

Simulations as part of some larger code structure are less conclusive, but one thing is certain, for both architectures it's less instructions and worst case same perf. Ideally rustc could generate the more efficient code for the obvious direct increment version.

### Meta

`rustc --version --verbose`:
```
rustc 1.75.0-nightly (187b8131d 2023-10-03)
binary: rustc
commit-hash: 187b8131d4f760f856b214fce34534903276f2ef
commit-date: 2023-10-03
host: x86_64-unknown-linux-gnu
release: 1.75.0-nightly
LLVM version: 17.0.2
```
Repository: transformers
Issue: Pruning/Compressing heads in attention blocks
Labels: Feature request

### Feature request

I've a conceptual question

BERT-base has a dimension of 768 for query, key and value and 12 heads (Hidden dimension=768, number of heads=12). The same is conveyed if we see the BERT-base architecture

```
(self): BertSelfAttention(
              (query): Linear(in_features=768, out_features=768, bias=True)
              (key): Linear(in_features=768, out_features=768, bias=True)
              (value): Linear(in_features=768, out_features=768, bias=True)
              (dropout): Dropout(p=0.1, inplace=False)
)
```
Now, my question is:

Can I consider the first 64 neurons from the _out_features_ as the first-head, the next 64 neurons from the _out_features_ as the 2nd head and so on? (sec 3.2.2 from original paper; [Link](https://papers.nips.cc/paper/2017/file/3f5ee243547dee91fbd053c1c4a845aa-Paper.pdf))

Basically, I am wondering if the Linear module representing query matrix; which is 768x768 can be thought as (768x64), (768x64)...12 times? 

If so, is it possible to provide some starter code as I am unable to wrap around my head. Any help is appreciated (and I've some sample in the contribution section)

**P.S:** Here's the issue from StackOverflow ([link](https://datascience.stackexchange.com/questions/124233/understanding-multi-headed-attention-from-architecture-details))

### Motivation

Example applications include papers from academia such as - [Paper1](https://lena-voita.github.io/posts/acl19_heads.html), [Paper2](https://github.com/pmichel31415/are-16-heads-really-better-than-1)

I referred to some of the previous posts ([link](https://datascience.stackexchange.com/questions/88330/how-do-the-linear-layers-in-the-attention-mechanism-work)), but I would appreciate any validation on this thought-process as it's similar but not same.

### Your contribution

Here's a code which prunes a particular % in particular layer depending on _layer_index_ and _prune_percentage_

```
model = AutoModelForMaskedLM.from_pretrained(checkpoint)

linear_layers_list = []
for name, layer in model.named_modules():
    if name in model_layers_list:
        linear_layers_list.append(layer)
print(f"No of linear layers are: {len(linear_layers_list)}")

layer = linear_layers_list[layer_index]
if prune_type == 'ln_structured':
    # Ln structured with n=1 i.e L1 pruning
    prune.ln_structured(layer, name='weight', amount=prune_percentage, dim=0, n=n)
```
I can understand that I can basically pass the Linear module and prune x% of weights.

Now, I would like to prune/remove one head in a similar fashion. 

Thanks
Repository: pytorch
Issue: [opcheck] Way to reduce Hypothesis sampling when running opcheck
Labels: triaged,module: opcheck

### 🐛 Describe the bug

Hypothesis sampling is very slow and typically it's pointless for a meta function test. It would greatly speedup opcheck tests if we can get rid of it.

@zou3519 says it's hard, because Hypothesis doesn't let you override settings. Maybe need to do some source code reading.

### Versions

main

cc @zou3519
Repository: rust
Issue: Display the reasons for the unused imports.
Labels: A-diagnostics,T-compiler

### Code

```Rust
mod a {
  pub const A:i32 = 1;
}

mod b {
  pub use crate::a::*;
  const _: i32 = A;
}

pub use a::*;
pub use b::*;

fn main() {}
```


### Current output

```Shell
warning: unused import: `b::*`
   --> src/main.rs
    |
    | pub use b::*;
    |         ^^^^
```


### Desired output

```Shell
warning: unused import: `b::*`
   --> src/main.rs
    |
    | pub use b::*;
    |         ^^^^
    | note: It is shadowed by ﻿`pub use a::*`
```


### Rationale and extra context

_No response_

### Other cases

_No response_

### Anything else?

_No response_
Repository: pytorch
Issue: [opcheck] Faster gradcheck execution
Labels: triaged,module: opcheck

### 🐛 Describe the bug

Running opcheck on gradcheck is pretty slow. We have a workaround for this in https://github.com/pytorch/FBGEMM/blob/f94254d24f8dc733a0a8c233e5ca368f0be04989/fbgemm_gpu/test/test_utils.py#L285 but it should be upstreamed to PT

### Versions

main

cc @zou3519
Repository: Web-Dev-For-Beginners
Issue: Bug reporting 
Labels: no-issue-activity

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
 - OS: [e.g. iOS]
 - Browser [e.g. chrome, safari]
 - Version [e.g. 22]

**Smartphone (please complete the following information):**
 - Device: [e.g. iPhone6]
 - OS: [e.g. iOS8.1]
 - Browser [e.g. stock browser, safari]
 - Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
Repository: godot
Issue: Improve textureSize usage in process material
Labels: enhancement,performance,topic:particles

### Godot version

4.2beta3

### System information

Fedora, RX 590

### Issue description

Follow up to https://github.com/godotengine/godot/pull/83831

The particle system currently uses textureSize() an unnecessary amount of times and it needs to be optimized.

### Steps to reproduce

/

### Minimal reproduction project

/
Repository: vscode
Issue: Installed User Version, but I am an  administrator - updates are blocked
Labels: install-update,windows,under-discussion,workbench-run-as-admin

<!-- ⚠️⚠️ 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/No

<!-- 🪓 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: September 2023 (version 1.83)
- OS Version: Windows 10 Enterprise

Steps to Reproduce:

1. Install user-scoped version of VS Code. 
2. I am an administrator
3. Allow the user-scoped version install to continue
4. Start up VS Code
5. Get message stating "Updates are disabled because you are running the user-scope installation..."

So what? Just because I'm an administrator doesn't mean that shouldn't be able to run my own "scoped" version on a particular machine. This machine is shared by several users, each of whom require their own "scoped" version. In fact, when I installed VSCode, it was put in MY user path - not some global path. I work on different projects than the other users of this machine, and need to be able to do whatever updates I need for my own projects on this machine.
I see multiple posts on the internet about this issue. You need to fix this...
Repository: vscode
Issue: Extension under development doesn't appear as an option in the issue reporter
Labels: bug,issue-reporter

Testing #180757

If I run https://github.com/Yoyokrazy/clean-nb-imports-ext in the extension development host, I don't see it as an option in the extension picker for the Report Issue UI. Maybe intentional but was a bit of a papercut testing this API, and filing in case this exposes some race in fetching extensions to report issues against
Repository: flutter
Issue: [Windows Arm64] Add Windows Arm64 engine CI
Labels: platform-windows,a: desktop,P3,platform-target-arm,team-windows,triaged-windows

## Background

Flutter is being updated to support Windows Arm64: https://flutter.dev/go/windows-arm64. See: https://github.com/flutter/flutter/issues/62597

Currently, Windows Arm64 artifacts are created from a Windows x64 host using cross-compilation.

## Work

Build and test the engine on a Windows Arm64 machine.
Repository: godot
Issue: Can't edit CodeEdit's arrays from the inspector
Labels: bug,topic:editor,usability

### Godot version

Godot v4.2.beta2 - Pop!_OS 22.04 LTS - X11 - Vulkan (Forward+) - integrated Intel(R) Graphics (ADL GT2) () - 12th Gen Intel(R) Core(TM) i5-1235U (12 Threads)

### System information

Godot v4.2.beta2 - Pop!_OS 22.04 LTS - X11 - Vulkan (Forward+) - integrated Intel(R) Graphics (ADL GT2) () - 12th Gen Intel(R) Core(TM) i5-1235U (12 Threads)

### Issue description

When I try to add elements to arrays in CodeEdit (e.g. the arrays of string/comment delimiters, bracket pairs) I just can't. For example, string delimiters, which are by default an array of size 2 with " and ' just flips around.

### Steps to reproduce

Create a CodeEdit and try to add more string or comment delimiters

### Minimal reproduction project

N/A
Repository: go
Issue: runtime/pprof: doesn't dump goroutine labels when stacks collected
Labels: NeedsInvestigation,compiler/runtime

<!--
Please answer these questions before submitting your issue. Thanks!
-->

### What version of Go are you using (`go version`)?

<pre>
$ go version
1.21.3
</pre>

### What did you do?

when collecting all goroutine call traces for debug purposes (e.g. using gops tool) one expects to see labels associated with goroutines. However, writeGoroutine() with debug>=2 which calls writeGoroutineStacks() do not provide them.

Yet legacy call traces provided with debug<2 in call like this:
```go
pprof.Lookup("goroutine").WriteTo(conn, 1)
```
provide goroutine labels.

### What did you expect to see?

goroutines stacks with labels.

### What did you see instead?

goroutines stacks without labels.
Repository: flutter
Issue: Automatically create `lib/src` when doing `flutter create -t package`
Labels: c: new feature,tool,c: proposal,P3,team-tool,triaged-tool

### Is there an existing issue for this?

- [X] I have searched the [existing issues](https://github.com/flutter/flutter/issues)
- [X] I have read the [guide to filing a bug](https://flutter.dev/docs/resources/bug-reports)

### Use case

It is a good practice, and almost always needed, to create a `src` directory inside of `lib` when developing a package.

### Proposal

My suggestion is that `flutter create -t package` automatically creates the `src` directory so that the package developer doesn't accidentally expose all internal code for the package.

Possible having an example file inside of the `src` directory too.

This issue was created after a discussion with @domesticmouse here: https://github.com/flutter/samples/issues/2045
Repository: flutter
Issue: [flutter_tools] RPCError: resume: (-32000) Bad state: The client is closed.
Labels: P2,team-tool,triaged-tool

Version: `stable/3.13.8`
Command: `debug_adapter`

```
RPCError: resume: (-32000) Bad state: The client is closed.
at new _OutstandingRequest(vm_service.dart:1928)
at VmService._call(vm_service.dart:2493)
at VmService.resume(vm_service.dart:2368)
at IsolateManager.resumeThread(isolate_manager.dart:287)
at IsolateManager._handlePause(isolate_manager.dart:498)
at IsolateManager.handleEvent(isolate_manager.dart:177)
at <asynchronous gap>(async)
at DartDebugAdapter.handleDebugEvent(dart.dart:2083)
at <asynchronous gap>(async)
at DartDebugAdapter._withErrorHandling(dart.dart:2424)
at <asynchronous gap>(async)
```