sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: pytorch
Issue: TorchScript: jit.script fails when using 'tolist' with int32 tensors.
Labels: oncall: jit

### 🐛 Describe the bug

**Description:**

I cannot use the 'tolist' builtin on a tensor with jit's scripting operation on an int32 tensor. Doing so will raise a RunTime error with the message "Output annotation element type and runtime tensor element type must match for tolist()". This is despite the int64 version working fine. This was found in a standard Google Colab environment, as well as my local machine.

**Expectations**

I would expect Int32Tensor.tolist() to be supported natively, with appropriate typing. Not throw a RunTime error. I might be wrong here, it might actually be a language feature. If this turns out to be the case,  and you are from the future, see the workaround.

**Workarounds**

For anyone else who encounters this bug, know that casting your tensors to int64 before calling tolist allows jit to compile correctly. 

**Reproduction**

Running the following code snippet is sufficient. It simply attempts to convert a tensor to a list and back.The int32 case will fail, but the int64 case will succeed.

```
import torch
from typing import List


@torch.jit.script
def test_tolist(item: torch.Tensor):
  """
  Convert input to a list, then back to an int64 tensor.
  """
  item: List[int] = item.tolist()
  item: torch.Tensor = torch.tensor(item, dtype=torch.int64)
  return item

test_int64 = torch.tensor([3, 2, 6], dtype=torch.int64)
test_int32 = torch.tensor([3, 2, 6], dtype=torch.int32)

test_tolist(test_int64) #Successful
test_tolist(test_int32) #Fails
```





### Versions

PyTorch version: 1.10.0+cu111
Is debug build: False
CUDA used to build PyTorch: 11.1
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: 6.0.0-1ubuntu2 (tags/RELEASE_600/final)
CMake version: version 3.12.0
Libc version: glibc-2.26

Python version: 3.7.13 (default, Mar 16 2022, 17:37:17)  [GCC 7.5.0] (64-bit runtime)
Python platform: Linux-5.4.144+-x86_64-with-Ubuntu-18.04-bionic
Is CUDA available: False
CUDA runtime version: 11.1.105
GPU models and configuration: Could not collect
Nvidia driver version: Could not collect
cuDNN version: Probably one of the following:
/usr/lib/x86_64-linux-gnu/libcudnn.so.7.6.5
/usr/lib/x86_64-linux-gnu/libcudnn.so.8.0.5
/usr/lib/x86_64-linux-gnu/libcudnn_adv_infer.so.8.0.5
/usr/lib/x86_64-linux-gnu/libcudnn_adv_train.so.8.0.5
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_infer.so.8.0.5
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_train.so.8.0.5
/usr/lib/x86_64-linux-gnu/libcudnn_ops_infer.so.8.0.5
/usr/lib/x86_64-linux-gnu/libcudnn_ops_train.so.8.0.5
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

Versions of relevant libraries:
[pip3] numpy==1.21.6
[pip3] torch==1.10.0+cu111
[pip3] torchaudio==0.10.0+cu111
[pip3] torchsummary==1.5.1
[pip3] torchtext==0.11.0
[pip3] torchvision==0.11.1+cu111
[conda] Could not collect
Repository: storybook
Issue: Mutation Observer childList is not detected
Labels: bug,web-components

**Describe the bug**
Mutation Observer `childList` is not detected on Storybook.

This is for `index.html` that specifies the component. See that `mutations` log exists

![Image 2022-04-25 at 13 33 55](https://user-images.githubusercontent.com/1243921/165016514-4022f81d-c5fb-4b23-8e2a-777ad3585f6c.jpg)

Below is Storybook, no `mutations` log displayed

![Image 2022-04-25 at 13 34 07@2x](https://user-images.githubusercontent.com/1243921/165016510-51e787fc-8f90-4633-a051-a2d6dea9a30d.jpg)

**To Reproduce**
It's reproducible in this repo https://github.com/deerawan/mutation-observer-storybook

Important files: 
- `action-group.ts` ([link](https://github.com/deerawan/mutation-observer-storybook/blob/f9660fd546775bd0207cc00f6a97aaaffb9d69a7/src/action-group.ts#L19))
- `index.html` ([link](https://github.com/deerawan/mutation-observer-storybook/blob/f9660fd546775bd0207cc00f6a97aaaffb9d69a7/index.html))
- `action-group.stories.ts` ([link](https://github.com/deerawan/mutation-observer-storybook/blob/f9660fd546775bd0207cc00f6a97aaaffb9d69a7/src/action-group.stories.ts))

**System**
```
System:
    OS: macOS 12.1
    CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
  Binaries:
    Node: 14.17.0 - ~/.asdf/installs/nodejs/14.17.0/bin/node
    Yarn: 1.22.18 - ~/.asdf/installs/nodejs/14.17.0/.npm/bin/yarn
    npm: 6.14.13 - ~/.asdf/installs/nodejs/14.17.0/bin/npm
  Browsers:
    Chrome: 100.0.4896.127
    Firefox: 99.0.1
    Safari: 15.2
  npmPackages:
    @storybook/addon-actions: ^6.4.22 => 6.4.22 
    @storybook/addon-essentials: ^6.4.22 => 6.4.22 
    @storybook/addon-links: ^6.4.22 => 6.4.22 
    @storybook/web-components: ^6.4.22 => 6.4.22 
```
Repository: next.js
Issue: redirect header conflict at getInitialProps and getServerSideProps
Labels: bug,Pages Router

### Verify canary release

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

### Provide environment information

    Operating System:
      Platform: linux
      Arch: x64
      Version: #185-Ubuntu SMP Tue Mar 29 17:40:04 UTC 2022
    Binaries:
      Node: 16.9.1
      npm: 7.21.1
      Yarn: 1.22.17
      pnpm: N/A
    Relevant packages:
      next: 12.1.6-canary.6
      react: 17.0.2
      react-dom: 17.0.2

### What browser are you using? (if relevant)

Chrome 100.0.4896.88

### How are you deploying your application? (if relevant)

localhost

### Describe the Bug

if header is set at getInitialProps in _app.js, then other redirect feature in getServerSideProps of other pages will trigger an error of `Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client`

e.g. 
in getInitialProps of _app.js:

```js
MyApp.getInitialProps = async (appContext) => {
    appContext?.ctx?.res?.writeHead?.(302, { Location: `/hello.html` });
    appContext?.ctx?.res?.end?.();
    return {};
}
```

in `getServerSideProps` of some page:
```js
export const getServerSideProps = async (ctx) =>{
    return {
        notFound: true,
    };
}
```

Then this error is logged when access the page
```
Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
    at new NodeError (node:internal/errors:371:5)
    at ServerResponse.setHeader (node:_http_outgoing:573:11)
    at setHeadersFromObject (/home/daniel/nextjs-redirect-error/node_modules/next/dist/compiled/compression/index.js:46:680)
    at ServerResponse.setWriteHeadHeaders (/home/daniel/nextjs-redirect-error/node_modules/next/dist/compiled/compression/index.js:46:914)
    at ServerResponse.writeHead (/home/daniel/nextjs-redirect-error/node_modules/next/dist/compiled/compression/index.js:46:121)
    at Function.MyApp.getInitialProps (webpack-internal:///./pages/_app.js:27:38)
    at Object.loadGetInitialProps (/home/daniel/nextjs-redirect-error/node_modules/next/dist/shared/lib/utils.js:65:29)
    at Object.renderToHTML (/home/daniel/nextjs-redirect-error/node_modules/next/dist/server/render.js:480:32)
    at async doRender (/home/daniel/nextjs-redirect-error/node_modules/next/dist/server/base-server.js:894:38)
    at async cacheEntry.responseCache.get.isManualRevalidate.isManualRevalidate (/home/daniel/nextjs-redirect-error/node_modules/next/dist/server/base-server.js:999:28) {
  code: 'ERR_HTTP_HEADERS_SENT'
}
```

### Expected Behavior

The redirection of getServerSideProps or other server side functions should be skipped if the header is set.

### To Reproduce

I have pushed a quick demo at github, you can reproduce the issue yourself

https://github.com/yfhui/nextjs-redirect-error
Repository: pytorch
Issue: Unexpected _LinAlgError appeared only on my device
Labels: triaged,module: linear algebra

### 🐛 Describe the bug

The _LinAlgError message appears when running `torch.linalg.solve` with the given variables in the hess_grad.txt file. However, this error message only appears when I run the code locally on the JupyterLab of my anaconda but not on my friends' laptop (i.e. cannot be reproduced on other devices).

file storing the variables:
[hess_grad.txt](https://github.com/pytorch/pytorch/files/8553023/hess_grad.txt)


sample code:
```python
import torch
path = "hess_grad.txt"
checkpoint = torch.load(path)
torch.linalg.solve(checkpoint["hess"], checkpoint["grad"])
```

error message:
```
---------------------------------------------------------------------------
_LinAlgError                              Traceback (most recent call last)
Input In [23], in <cell line: 3>()
      1 path = "hess_grad.txt"
      2 checkpoint = torch.load(path)
----> 3 torch.torch.linalg.solve(checkpoint["hess"], checkpoint["grad"])

_LinAlgError: linalg.solve: The diagonal element 2 is zero, the solve could not be completed because the input matrix is singular.
```

### Versions

PyTorch version: 1.11.0
Is debug build: False
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A

OS: macOS 12.3.1 (x86_64)
GCC version: Could not collect
Clang version: 13.1.6 (clang-1316.0.21.2.3)
CMake version: Could not collect
Libc version: N/A

Python version: 3.9.7 (default, Sep 16 2021, 08:50:36)  [Clang 10.0.0 ] (64-bit runtime)
Python platform: macOS-10.16-x86_64-i386-64bit
Is CUDA available: False
CUDA runtime version: No CUDA
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

Versions of relevant libraries:
[pip3] mypy-extensions==0.4.3
[pip3] numpy==1.21.5
[pip3] numpydoc==1.2
[pip3] torch==1.11.0
[pip3] torchaudio==0.11.0
[pip3] torchvision==0.12.0
[conda] blas                      1.0                         mkl  
[conda] mkl                       2021.4.0           hecd8cb5_637  
[conda] mkl-service               2.4.0            py39h9ed2024_0  
[conda] mkl_fft                   1.3.1            py39h4ab4a9b_0  
[conda] mkl_random                1.2.2            py39hb2f4e1b_0  
[conda] mypy_extensions           0.4.3            py39hecd8cb5_1  
[conda] numpy                     1.21.5           py39h2e5f0a9_1  
[conda] numpy-base                1.21.5           py39h3b1a694_1  
[conda] numpydoc                  1.2                pyhd3eb1b0_0  
[conda] torch                     1.11.0                   pypi_0    pypi
[conda] torchaudio                0.11.0                   pypi_0    pypi
[conda] torchvision               0.12.0                   pypi_0    pypi

cc @jianyuh @nikitaved @pearu @mruberry @walterddr @IvanYashchuk @xwang233 @Lezcano
Repository: ant-design
Issue: Add description below image in upload component
Labels: 💡 Feature Request,Inactive

### Reproduction link

[![Edit on CodeSandbox](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/antd-reproduction-template-forked-67vhl2?file=/index.js)

### Steps to reproduce

When user add image. below added needs to show to image description text

### What is expected?

when user upload image need to add description. Description should show below the image.

Expected output UI
Need to display description text on the red line
![image](https://user-images.githubusercontent.com/60467237/165065159-7e5f0610-2688-45cf-9845-2f3ecddf9b43.png)


### What is actually happening?

User upload only image alone

| Environment | Info |
| --- | --- |
| antd | 4.8.2 |
| React | 16.4 |
| System | Windows 10 |
| Browser | Chrome |

<!-- generated by ant-design-issue-helper. DO NOT REMOVE -->
Repository: PowerToys
Issue: Activation Shortcut, all just "Windows Key" and option to "fall back"
Labels: Idea-Enhancement,Product-PowerToys Run

### Description of the new feature / enhancement

In order to really start using this, I really want to use just Windows key, like I have for years. However, you cannot just use Win to activate PowerToys Run.

I would like the ability for Windows Key to open PowerToys Run and configure a short-cut for normal windows key action. This is how it's done the program "Open-Shell". However, it would be nice to have more configurability. 
 
![image](https://user-images.githubusercontent.com/4396667/165079199-f2a2afdd-2989-4e1d-bf9b-adc6a2a3d57f.png)


 


### Scenario when this would be used?

Without replacing the Windows Key, I can never really get used to using this. 

I have tried Windows Key+Space but this does not work well for me and also does not work if a foreground all is elevated.

### Supporting information

_No response_
Repository: vscode
Issue: Detect when our `vscode://` UriHandler isn't registered on the OS and inform the user
Labels: debt,engineering,workbench-os-integration,authentication

The GitHub Auth extension has taken a heavier dependency on the UriHandler API last iteration. As a result, I have had to answer to [so(1)](https://github.com/microsoft/vscode-pull-request-github/issues/3472) [many(2)](https://github.com/microsoft/vscode/issues/147915) [of(3)](https://github.com/microsoft/vscode/issues/147104) [the(4)](https://github.com/microsoft/vscode/issues/147446) same issue. 

This iteration, I added some fallback logic to handle when the `UriHandler` doesn't work as expected, but we should handle this better and inform the user what they need to do in order to get what they want... or provide a mechanism for extensions to know when the `UriHandler` won't work so they can easily handle accordingly.

I added @deepak1556 since you know a lot about the underlying implementation of UriHandler and @joaomoreno because I think you own it? I could be wrong.

btw, this happens if you attempt to use the Linux zip build or the Windows zip build... but there are workarounds that can be applied on these systems to get the UriHandler working.
Repository: pytorch
Issue: More understandable name column of the table of the profiling result.
Labels: oncall: profiler

### 🚀 The feature, motivation and pitch

When printing the profiled result like below, the name column is too narrow to show the understandable name.

```python
print(prof.key_averages())
```

For example, it's not clear what kind of elementwise_kernels are they in the screenshot below.

![Screenshot from 2022-04-22 23-19-22](https://user-images.githubusercontent.com/32722944/165097946-468d8f6c-609d-4637-9f96-2cc0ccdacaf5.png)

It seems that the upper bound of the column width is [fixed here](https://github.com/pytorch/pytorch/blob/master/torch/autograd/profiler_util.py#L688).
So I would like to add parameter to change the column width.
I'm considering simply adding `max_name_column_width` parameter to `table` method of `EventList` class.

### Alternatives

## Alternative 1
First alternative is implementing a way to show concise names at name column.

## Alternative 2
Alternative is exporting profiled result in other format and visualize with other tool or scripts.


### Additional context

_No response_

cc @ilia-cher @robieta @chaekit @gdankel @bitfort @ngimel @nbcsm @guotuofeng @guyang3532 @gaoteng-git
Repository: go
Issue: runtime: dump a summary of heap stats on OOM
Labels: NeedsInvestigation,compiler/runtime

I'm seeing fairly frequent OOM failures in the Go build dashboard.

Some of them look like misconfigured or undersized builders, while others could plausibly be bugs in the runtime (such as #52433). In other cases (such as #49957), it's much less clear what led to the failure.

It would be very helpful to be able to distinguish those cases from the failure logs. Today, we get `fatal error: runtime: out of memory`, but generally the runtime doesn't actually tell us how much memory it was using when that happened. (We do get a goroutine dump, but a goroutine dump is only loosely correlated with the size of the heap.)

@golang/runtime: how difficult would it be to have the runtime dump a best-effort summary of heap stats when it hits the `out of memory` condition?
Repository: rust
Issue: [rustdoc] query symbol docs on the CLI
Labels: T-rustdoc,C-feature-request,A-CLI

Hi all

I saw this feature in this [haredoc announcement](https://harelang.org/blog/2022-04-25-announcing-hare/#haredoc) so I propose a similar function for rustdoc (or a cargo plugin).

Looking forward for your ideas :)

## Query

For the current project one could query like this, maybe the `crate::` should be prefixed always.

```bash
cargo doc --query crate::some_function
cargo doc --query ::some_function
```

For deps one would issue commands like this:

```bash
cargo doc --query std::collections::HashMap
```

## Results

Some docs are very long, so chopping after the second sentence feels like an okay first heuristic. 

```
pub struct std::collections::HashMap<K, V, S = RandomState> { /* private fields */ }
        A hash map implemented with quadratic probing and SIMD lookup.

        By default, HashMap uses a hashing algorithm selected to provide
        resistance against HashDoS attacks.
```

One option is to not display the full path of the symbol in the response to destill the response.

The output should be indented according to the current terminal width of the user.

## Nice features

If the user queries for a struct or trait we could display constructor or common functions like `new`.

```
pub struct std::collections::HashMap<K, V, S = RandomState> { /* private fields */ }
        A hash map implemented with quadratic probing and SIMD lookup.

        By default, HashMap uses a hashing algorithm selected to provide
        resistance against HashDoS attacks.

Constructors functions:
        pub fn new() -> HashMap<K, V, RandomState>
        pub fn with_capacity(capacity: usize) -> HashMap<K, V, RandomState>
        ... (two more)
```

Adding a section showing the traits would be another idea:
```
Traits:
       Debug, Display, PartialEq, Eq
```

## Extra features

One idea would be to catch typos in the queries if nothing is found.
Eg. `std::collection` would then find the plural `std::collections`

Another would be to integrate it with `cargo check` which could output the doc if there is only one error in one build.

## Similar technology

https://github.com/rust-lang/rls has a `full_docs` feature that allows a client to query for the docs.
Other IDEs have other means to query for docs.
Repository: vscode
Issue: Report Issue should warn on outdated VS Code / Extension
Labels: feature-request,issue-reporter

Report issue is the best way to file an issue, as it will include all the diagnostic data. A common problem that is easy to spot is when VS Code or extensions are outdated. Good reports are filed from the latest stable VS Code, the best from the latest Insiders.

What if _Report Issue_ checks of the setup is outdated and asks users to update before filing an issue.

This might also help _Python_, which opens the built-in issue reporter for their action.
Repository: vscode
Issue: Git - Add copy branch name in the sync status bar item hover
Labels: feature-request,git

<!-- ⚠️⚠️ Do Not Delete This! feature_request_template ⚠️⚠️ -->
<!-- Please read our Rules of Conduct: https://opensource.microsoft.com/codeofconduct/ -->
<!-- Please search existing issues to avoid creating duplicates. -->

<!-- Describe the feature you'd like. -->
![Screenshot from 2022-04-25 14-01-29](https://user-images.githubusercontent.com/21298211/165147466-92d3ec3c-e9e6-4720-84e4-c2cf266bf809.png)
I need to copy the branch name often enough that I wish there was a way to copy the branch name from the bottom left corner. 
This should also be able to copy from the Source Control Panel under the branch menu.
Repository: pytorch
Issue: [Checkpoint] Add module documentation
Labels: triaged,sharded_tensor

### 🚀 The feature, motivation and pitch

The documentation for checkpoint is currently restricted to each public method.

We don't have a good place to explain the overall package and its usage.



### Alternatives

Keep all docs on each method as is today.

### Additional context

_No response_
Repository: pytorch
Issue: [checkpoint] Support models with different cross-rank metadata
Labels: triaged,sharded_tensor

### 🚀 The feature, motivation and pitch

Some models can have different checkpoint metadata across ranks.

Extend our API / implementation to handle those scenarios.

### Alternatives

_No response_

### Additional context

_No response_
Repository: pytorch
Issue: [checkpoint] Add extension points to avoid the default serialization behavior
Labels: triaged,sharded_tensor

### 🚀 The feature, motivation and pitch

Checkpointing code currently uses pickle and torch.load/torch.save for serialization.
We should have extension points to allow users to override those as they happen outside of the storage layer.

### Alternatives

_No response_

### Additional context

_No response_
Repository: pytorch
Issue: [checkpoint] Avoid loading whole tensor when resharding 
Labels: triaged,sharded_tensor

### 🚀 The feature, motivation and pitch


The FileSystem implementation of the storage layer uses torch.load / torch.save to serializer tensors.
While this is ok for saving, it's a problem when resharding during load as we can't do a partial read and load the whole tensor in memory first before copying a small part of it to its destination.

This could lead to OOM when resharding to a small memory target and wastes IO bandwidth.



### Alternatives

_No response_

### Additional context

_No response_