sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: pytorch
Issue: How to efficiently (without looping) get data from tensor predicted by a torchscript in C++?
Labels: oncall: jit

I am calling a torchscript (neural network serialized from Python) from a C++ program:

```
  // define inputs
  int batch = 3; // batch size
  int n_inp = 2; // number of inputs
  double I[batch][n_inp] = {{1.0, 1.0}, {2.0, 3.0}, {4.0, 5.0}}; // some random input
  std::cout << "inputs" "\n";  // print inputs
  for (int i = 0; i < batch; ++i)
  {    
    std::cout << "\n";
    for (int j = 0; j < n_inp; ++j)
    {
      std::cout << I[i][j] << "\n";
    }
  }

   // prepare inputs for feeding to neural network
  std::vector<torch::jit::IValue> inputs;
  inputs.push_back(torch::from_blob(I, {batch, n_inp}, at::kDouble));

  // deserialize and load scriptmodule
  torch::jit::script::Module module;
  module = torch::jit::load("Net-0.pt");

  // do forward pass
  auto outputs = module.forward(inputs).toTensor();
```

Usually, to get data from the outputs, the following (element-wise) operation is performed:

```
  // get data from outputs
  std::cout << "outputs" << "\n";
  int n_out = 1;
  double outputs_data[batch][n_out];
  for (int i = 0; i < batch; i++) 
  {
    for (int j = 0; j < n_out; j++)
    {
      outputs_data[i][j] = outputs[i][j].item<double>();
      std::cout << outputs_data[i][j] << "\n";
    }
  }
```

However, such looping using .item is highly inefficient (in the actual code I will have millions of points predicted at each time step). I want to get data from outputs directly (without looping over elements). I tried:

  ```
int n_out = 1;
  double outputs_data[batch][n_out];
  outputs_data = outputs.data_ptr<double>();
```
However, it is giving the error:

```
error: incompatible types in assignment of ‘double*’ to ‘double [batch][n_out]’
   outputs_data = outputs.data_ptr<double>();
                                           ^
```
Note, that type of outputs_data is fixed to double and cannot be changed.

cc @gmagogsfm
Repository: vscode
Issue: Blank space above integrated terminal when using decimal value for window.zoomLevel
Labels: bug,confirmed,terminal-layout


Issue Type: <b>Bug</b>

**Steps to reproduce:**

1. Install the [Ubuntu font family](https://design.ubuntu.com/font/) (download link is at the bottom of the page).
2. Start vanilla session of VS Code Insiders.
3. Open Command Palette, enter `Preferences: Open Settings (JSON)`, paste the following settings, and save:

```json
{
    "editor.fontFamily": "Ubuntu Mono",
    "telemetry.enableTelemetry": false,
    "telemetry.enableCrashReporter": false,
    "terminal.integrated.fontSize": 16,
    "window.zoomLevel": 0.4
}
```

4. Open Command Palette and enter `View: Toggle Terminal`.
5. Drag the Terminal tab to the Activity Bar and click on it.

**Actual result:** There is blank space above the terminal contents (you can see the effect better when filling the terminal by repeatedly pressing Enter and examining the size of the scrollbar; there is blank space above the scrollbar slider even when scrolled all the way to the top).

**Expected result:** There is little to no space above the terminal contents (the height of the blank space should not exceed the height of one terminal line).

**Additional information:**
- The blank space vanishes when using `0.3` or `0.5` for `window.zoomLevel`.
- The developer tools indicate that the `terminal-split-pane` `div` has the correct height, but the height of the `xterm-screen` `div` is too small.
- Due to firewall restrictions, I'm currently not able to provide screenshots.

VS Code version: Code - Insiders 1.60.0-insider (f0913d7718bbc4a805cd3a051335b4df60ca5d77, 2021-08-17T05:15:18.727Z)
OS version: Windows_NT x64 10.0.18363
Restricted Mode: No

<details>
<summary>System Info</summary>

|Item|Value|
|---|---|
|CPUs|Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz (12 x 2592)|
|GPU Status|2d_canvas: enabled<br>gpu_compositing: enabled<br>multiple_raster_threads: enabled_on<br>oop_rasterization: enabled<br>opengl: enabled_on<br>rasterization: enabled<br>skia_renderer: enabled_on<br>video_decode: enabled<br>vulkan: disabled_off<br>webgl: enabled<br>webgl2: enabled|
|Load (avg)|undefined|
|Memory (System)|31.59GB (15.51GB free)|
|Process Argv||
|Screen Reader|no|
|VM|0%|
</details>Extensions: none
<!-- generated by issue reporter -->
Repository: material-ui
Issue: BottomNavigationAction component types conflict
Labels: new feature,typescript

- [x] The issue is present in the latest release.
- [x] I have searched the [issues](https://github.com/mui-org/material-ui/issues) of this repository and believe that this is not a duplicate.

## Current Behavior 😯

When creating a `BottomNavigationAction` using a Link as a `component` & an `onChange` function prop it will trigger a `No overload matches this call` type error, even though this is a valid behaviour (& works just fine).

## Expected Behavior 🤔

The types of `BottomNavigationAction` should reflect the allowed behaviour.

## Steps to Reproduce 🕹

https://codesandbox.io/s/bottomnavigationaction-issue-g6txi?file=/CustomAction.tsx:408-438

## Context 🔦

I want to listen to the change event on a `BottomNavigationAction` component, which is rendered as a `Link`

## Your Environment 🌎

<!--
  Run `npx @material-ui/envinfo` and post the results.
  If you encounter issues with TypeScript please include the used tsconfig.
-->
<details>
  <summary>`npx @material-ui/envinfo`</summary>
Summary of the result: 

System:
    OS: macOS 11.5.1
    CPU: (8) x64 Intel(R) Core(TM) i7-7920HQ CPU @ 3.10GHz
    Memory: 21.36 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 14.17.3 - ~/.nvm/versions/node/v14.17.3/bin/node
    Yarn: 1.22.1 - ~/.nvm/versions/node/v12.22.1/bin/yarn
    npm: 6.14.13 - ~/.nvm/versions/node/v14.17.3/bin/npm
  Browsers:
    Chrome: 92.0.4515.159
  Monorepos:
    Yarn Workspaces: 1.22.1
    Lerna: 4.0.0
</details>
Repository: rust
Issue: Invalid `dyn` suggestions
Labels: T-compiler,C-bug,A-suggestion-diagnostics,D-invalid-suggestion,A-edition-2021

In a small crater run for the 2021 edition migrations, a few problems turned up with the suggestions we give for missing `dyn` keywords:

- Invalid suggestion to change `Trait::thing` to `<dyn Trait>::thing` without generic args:
  - https://crater-reports.s3.amazonaws.com/pr-87190-2/try%23d8627d19850b63702b76089d7b055730e9ddca14/reg/biofile-1.10.2/log.txt
  - https://crater-reports.s3.amazonaws.com/pr-87190-2/try%23d8627d19850b63702b76089d7b055730e9ddca14/reg/epoxy_streams-0.3.1/log.txt
- Invalid suggestion to change `<Trait>::..` to `<<dyn Trait>>::..`: https://crater-reports.s3.amazonaws.com/pr-87190-2/try%23d8627d19850b63702b76089d7b055730e9ddca14/reg/extended-primitives-0.3.5/log.txt
Repository: rust
Issue: closure capture migrations do not note when move is now required
Labels: A-closures,T-compiler,A-edition-2021

In a small crater run for the 2021 edition migrations, a few problems shows up with closures no longer compiling after migration:


  - https://crater-reports.s3.amazonaws.com/pr-87190-2/try%23d8627d19850b63702b76089d7b055730e9ddca14/reg/finality-grandpa-0.14.3/log.txt
  - https://crater-reports.s3.amazonaws.com/pr-87190-2/try%23d8627d19850b63702b76089d7b055730e9ddca14/reg/tantivy-0.15.3/log.txt
  - https://crater-reports.s3.amazonaws.com/pr-87190-2/try%23d8627d19850b63702b76089d7b055730e9ddca14/reg/tetsy-finality-grandpa-0.13.0/log.txt
Repository: rust
Issue: `rustc_data_structures::jobserver` should fall back to an in-process implementation if no jobserver in environment
Labels: C-enhancement,T-compiler

In https://github.com/rust-lang/rust/issues/88091 we discovered a scaling limit on concurrent `rustc` invocations when run outside of a build system that provides a jobserver pipe. In that configuration, the compiler [creates its own pipe](https://github.com/rust-lang/rust/blob/673d0db5e393e9c64897005b470bfeb6d5aec61b/compiler/rustc_data_structures/src/jobserver.rs#L23) for internal thread scheduling, which means that each invocation of `rustc` makes a pipe with two pages. On Linux, there is a soft limit on the number of per-user pipe pages which roughly nets out to allowing up to 512 concurrent `rustc`s if there were no other processes using pipes.

Per @alexcrichton in https://github.com/rust-lang/rust/issues/88091#issuecomment-899864927, this fallback jobserver doesn't need to be inherited by any forked processes which should mean it's OK to use an in-process concurrency controller instead of the jobserver client.

Looking at the code, I think it should be possible to refactor `rustc_data_structures::jobserver::client()` to return a shim that can either dispatch to a real jobserver client or to an in-process semaphore. The client only seems to be used for `rustc_data_structures::jobserver::{schedule_thread,release_thread}` and for LLVM thread creation, so it should be a smallish refactor.

cc @tmandry
Repository: vscode
Issue: Ensure that scm.focus command works in all cases
Labels: bug,scm

Related to https://github.com/microsoft/vscode/issues/119904
Repository: vscode
Issue: SCM Input - Expand SCM input validation support
Labels: feature-request,api,scm,api-finalization

Current proposal:

```ts
	/**
	 * Represents the validation type of the Source Control input.
	 */
	export enum SourceControlInputBoxValidationType {

		/**
		 * Something not allowed by the rules of a language or other means.
		 */
		Error = 0,

		/**
		 * Something suspicious but allowed.
		 */
		Warning = 1,

		/**
		 * Something to inform about but not a problem.
		 */
		Information = 2
	}

	export interface SourceControlInputBoxValidation {

		/**
		 * The validation message to display.
		 */
		readonly message: string | MarkdownString;

		/**
		 * The validation type.
		 */
		readonly type: SourceControlInputBoxValidationType;
	}

	/**
	 * Represents the input box in the Source Control viewlet.
	 */
	export interface SourceControlInputBox {

		/**
		 * Shows a transient contextual message on the input.
		 */
		showValidationMessage(message: string | MarkdownString, type: SourceControlInputBoxValidationType): void;

		/**
		 * A validation function for the input box. It's possible to change
		 * the validation provider simply by setting this property to a different function.
		 */
		validateInput?(value: string, cursorPosition: number): ProviderResult<SourceControlInputBoxValidation>;
	}
```

Refs: https://github.com/microsoft/vscode/issues/119919
Repository: pytorch
Issue: Consolidate distributed benchmark folders
Labels: oncall: distributed,module: bootcamp,pt_distributed_rampup,module: ddp

It looks like we have OSS benchmarks in benchmarks/distributed/ as well as torch/distributed/benchmarks folders. It would be good to merge these into a single top-level directory so that all open-sourced benchmarks for DDP, RPC etc can be found in a common folder.

cc @pietern @mrshenli @pritamdamania87 @zhaojuanmao @satgera @rohan-varma @gqchen @aazzolini @osalpekar @jiayisuse @agolynski @SciPioneer @H-Huang @mrzzd @cbalioglu @gcramer23
Repository: go
Issue: cmd/go: go mod verify should check hashes in go.sum against GOSUMDB.
Labels: NeedsFix,FeatureRequest,modules

### What version of Go are you using (`go version`)?

<pre>
$ go version
1.17
</pre>

### Does this issue reproduce with the latest release?

yes

### What did you do?

1. Tag a version of a module, say `example.com/m@v0.1.0`.
2. Set `GOPROXY=direct`, `GOSUMDB=off`, then `go get example.com/m@v0.1.0` in another module. This downloads the version into the cache without notifying `proxy.golang.org` or `sum.golang.org` and adds a sum to `go.sum`.
3. Change something and update the version tag to point to the new change.
4. Clear `GOPROXY` and `GOSUMDB`.
5. Run `go mod verify`, observing no security error.
6. Clean the module cache with `go clean -modcache`.
7. Run `go list all` or any other command that would download the modified version, observing a security error.

https://github.com/jayconrod/noverify is an example repo. `github.com/jayconrod/noverify@v0.1.0` was modified, `github.com/jayconrod/noverify/sum` is the dependent module.

### What did you expect to see?

The first `go mod verify` command should report a security error. For each module in the build list not matched by `GOPRIVATE` or `GONOSUMDB` (that is, each publicly available module), `go mod verify` should check the hash of the downloaded module and the hash in `go.sum` against the checksum database in `GOSUMDB`, assuming it is not disabled.

In this scenario, that hash won't be in the checksum database, and the lookup should cause `sum.golang.org` to fetch `example.com/m@v0.1.0` from its origin and return the sum for the modified version. `go mod verify` would then report a security error because that sum will not match the original sum in the dependent module's `go.sum`. `go mod verify` should also report a security error if `sum.golang.org` returns any error response (most commonly, 404 or 410) or is not available.

This is important for identifying when both `go.sum` and the contents of the module cache don't match a publicly available version. People in this situation will see their builds work fine, but builds for other developers and CI builds will fail. `go mod verify` only checks that `go.sum` matches the contents of the module cache. It will only consult the checksum database if it needs to download something that's not cached.

### What did you see instead?

`go mod verify` reports no security error in step 5.
Repository: create-react-app
Issue: Swap files generated when using npm start
Labels: stale,needs triage,issue: bug report

### Describe the bug
I'm not super experienced, so please let me know if there's something I forgot to include! The issue is that swap files like `file.js.swp` and `file.js.swo` are being created when using `npm start` on my create-react-app project. `npm start` is hooked up to `react-scripts start` inside my package.json. Inside the terminal where I ran `npm start`, it's as if I opened a vim editor. Here's my package.json in case that helps:

```
{
  "name": "battleship",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@testing-library/jest-dom": "^5.11.4",
    "@testing-library/user-event": "^12.1.10",
    "react": "^17.0.2",
    "react-dom": "^17.0.2",
    "react-scripts": "4.0.3"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  },
  "devDependencies": {
    "@testing-library/react": "^11.2.7",
    "@testing-library/react-hooks": "^7.0.0",
    "react-test-renderer": "^17.0.2"
  }
}

```
Repository: pytorch
Issue: torch.arange has issue tracing with bool input
Labels: oncall: jit

## 🐛 Bug
```
import torch

inp = (True,)
print(torch.arange(*inp).size())
# torch.Size([1])

x = lambda: torch.arange(*inp)
torch.jit.trace(x, ())
```
> RuntimeError: 0INTERNAL ASSERT FAILED at "../torch/csrc/jit/ir/alias_analysis.cpp":533, please report a bug to PyTorch. We don't have an op for aten::arange but it isn't a special case.  Argument types: bool, NoneType, int, Device, bool,



cc @gmagogsfm
Repository: flutter
Issue: Themable mouse cursors
Labels: c: new feature,framework,f: material design,c: proposal,a: mouse,team-design,triaged-design

Some Material widgets are missing a themeable mouse cursor.

## Use case

For example, desktop-oriented themes might not want cursors changing over buttons and alike. In this case, it would be desirable to define mouse cursors in an application-wide theme: https://github.com/ubuntu/yaru_widgets.dart/issues/840

## Proposal

Add `FooThemeData.mouseCursor` for all widgets that have a `Foo.mouseCursor` property.

According to a quick search, _at least_ these widgets are missing a themeable mouse cursor:

- [x] BottomNavigationBar: #96736
- [ ] Dropdown: [dropdown.dart](https://github.com/flutter/flutter/blob/79d32877c93313506a7994423e2b5f8c92587f3c/packages/flutter/lib/src/material/dropdown.dart#L1542)
- [x] FloatingActionButton: #103473
- [ ] IconButton: [icon_button.dart](https://github.com/flutter/flutter/blob/66597ffb78caa7fb36c682ab98f9b54b9ea1f16a/packages/flutter/lib/src/material/icon_button.dart#L384)
- [x] ListTile: #96740
- [x] PopupMenuItem: #96567
- [x] Slider: #96623
- [x] TabBar: #96737
Repository: vscode
Issue: [Feature Request] Bracket Pair Colorization: Force unique opening color
Labels: feature-request,bracket-pair-colorization

<!-- ⚠️⚠️ 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. -->

This would be porting over said feature from Bracket Pair Colorizer 2

"`bracket-pair-colorizer-2.forceUniqueOpeningColor`"
![image](https://user-images.githubusercontent.com/75278/129780602-b5d94d83-3f4a-4103-955d-66f9bfbbf936.png)
![image](https://user-images.githubusercontent.com/75278/129780611-be1d4cfa-4d77-41d8-a30f-166ed2ff851e.png)
Repository: node
Issue: Core should bundle a code formatter for contributors.
Labels: lib / src

<!--
Thank you for suggesting an idea to make Node.js better.

Please fill in as much of the template below as you're able.
-->

**Is your feature request related to a problem? Please describe.**
Please describe the problem you are trying to solve.

When writing PRs to Node core I spend too much time dealing with code formatting. There should be some command that I can run that automatically formats code so I can get features done rather than spending sometimes an hour or more fiddling with whitespace rules and line lengths to make the linter happy.

**Describe the solution you'd like**
Please describe the desired behavior.

I should be able to run some command such as `make fmt` that automatically deals w/ line lengths, whitespace, etc. so I don't hear about it from these stylistic choices from the linter when I run `make lint`.

**Describe alternatives you've considered**
Please describe alternative solutions or features you have considered.

Continuing to just bear this linter anger in my PRs.
Repository: TypeScript
Issue: quickfix: convert to es6 should add extension
Labels: Suggestion,Awaiting More Feedback

*TS Template added by @mjbvz*

**TypeScript Version**: 4.3.5

**Search Terms**
- code action
- suggestion

---

<!-- ⚠️⚠️ 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.59.0
- OS Version: Mac 10.15.7

Steps to Reproduce:

1. Take any commonjs project (not written in typescript) 
2. Do the quick fix of converting any javascript project into a ES6

Then the extension is omitted. I think it should automatically be added. Cuz ESM is strict about file paths.

---

- old code: `var dateFormat = require("../lib/dateformat");`
- after conversion: `import dateFormat from "../lib/dateformat";` (file not found)
- expected `import dateFormat from "../lib/dateformat.js";`
Repository: vscode
Issue: Improve discoverability of available/installable output renderers for given mime types
Labels: feature-request,ux,notebook-output

## Summary
This issue captures the design explorations for improving the discoverability of output renderers. There are two main scenarios we want to focus on:

- When a notebook tries to use a renderer that is unavailable
- When a notebook uses a renderer that the user did not expect to see

Given these two main scenarios, we want to explore ways to increase the visibility of output renderers.

## Designs

## Display badges

One simple idea would be to show a "badge" when there is an output renderer unavailable and also show an option to search the marketplace for other renderers:

![image](https://user-images.githubusercontent.com/35271042/129783420-b6c7ed24-212f-4549-9c18-d6fdd616bf78.png)

<img width="735" alt="CleanShot 2021-08-17 at 11 48 58@2x" src="https://user-images.githubusercontent.com/35271042/129783519-e517f95f-1f58-4cab-b5a1-44a857edc0a1.png">

## Status bar item

We could also add a status bar item for more of a seamless plug that would point to the same quick pick from above:

<img width="760" alt="CleanShot 2021-08-17 at 11 49 21@2x" src="https://user-images.githubusercontent.com/35271042/129783659-bba1ffb2-de8f-47b2-963b-bf4bfbef8568.png">

In the case where we have multiple outputs, we could consolidate the status bar items and show a list of the outputs before (though it's not best experience correlating the output list + visuals):

<img width="752" alt="CleanShot 2021-08-17 at 11 54 17@2x" src="https://user-images.githubusercontent.com/35271042/129784222-658fadd1-34ab-49ac-8664-b50d2c52a64f.png">


<img width="650" alt="CleanShot 2021-08-17 at 11 53 22@2x" src="https://user-images.githubusercontent.com/35271042/129784161-eb0b45e1-cb00-4f70-a2c5-c4eed27b1f0c.png">

And a "left-aligned" alternative:

<img width="804" alt="CleanShot 2021-08-17 at 11 54 59@2x" src="https://user-images.githubusercontent.com/35271042/129784357-b4812368-aee7-4678-bd99-1c1faba01aae.png">

## New output toolbar

We could move the output actions (currently in the ellipsis) into a new toolbar above each output, which would also be a place to highlight missing renderers:

<img width="766" alt="CleanShot 2021-08-17 at 11 59 33@2x" src="https://user-images.githubusercontent.com/35271042/129785338-8510678a-939c-4fe5-8cca-6dff1b58c5c7.png">

An alternative would be to place alignment on the right and use a dropdown for quick changes. However, there is limited space in the dropdown to communicate and would contradict other patterns where we use the quick pick:

<img width="807" alt="CleanShot 2021-08-17 at 12 07 04@2x" src="https://user-images.githubusercontent.com/35271042/129785814-046003e6-9db2-4807-aa1d-cab3675f1f45.png">