sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: pytorch
Issue: Returning a tensor instead of a list in split and chunk
Labels: feature,triaged,has workaround,shadow review

## 🚀 Feature

It would be nice to be able to get a tensor instead of a list of tensors when splitting or chunking if the dimensions match. What I propose is to add a flag (that could be called something like `return_tensor`) to split and chunk to do so. Here is an example of implementation.

```python
def view_chunk(tensor, chunks, dim=0):
    assert tensor.shape[dim] % chunks == 0
    if dim < 0:  # Support negative indexing
        dim = len(tensor.shape) + dim
    cur_shape = tensor.shape
    new_shape = cur_shape[:dim] + (chunks, tensor.shape[dim] // chunks) + cur_shape[dim + 1:]
    return tensor.reshape(*new_shape)

def view_split(tensor, split_size, dim=0):
    assert tensor.shape[dim] % split_size == 0
    if dim < 0:  # Support negative indexing
        dim = len(tensor.shape) + dim
    cur_shape = tensor.shape
    new_shape = cur_shape[:dim] + (tensor.shape[dim] // split_size, split_size) + cur_shape[dim + 1:]
    return tensor.reshape(*new_shape)
```

## Motivation

Essentially, the goal is to avoid copying memory when subsequently stacking the split afterwards if desirable. For instance, this can be useful when wanting to separate the dimensions of the output of an RNN.

## Pitch

```python
torch.chunk(tensor, chunks, dim=dim) # returns a list of tensors
torch.chunk(tensor, chunks, dim=dim, return_tensor=True) # returns a tensor with a new dimension
```

cc @ezyang @VitalyFedyunin @ngimel
Repository: TypeScript
Issue: Support Implicit Generics Inference
Labels: Suggestion,Awaiting More Feedback

<!-- 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨

Half of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker.

Please help us by doing the following steps before logging an issue:
  * Search: https://github.com/Microsoft/TypeScript/search?type=Issues
  * Read the FAQ, especially the "Common Feature Requests" section: https://github.com/Microsoft/TypeScript/wiki/FAQ

-->

## Search Terms

<!-- List of keywords you searched for before creating this issue. Write them down here so that others can find this suggestion more easily -->
implicit generics, broader type inference, better type inference

## Suggestion

<!-- A summary of what you'd like to see added or changed -->
I'd like TypeScript to know when two types are **unknown**, but **equal**.
That is, say I've function `equals()`:

```ts
type T = { type: 'a', p1: boolean } | { type: 'b', p2: string };

function equals(a: T, b: T) {
  // Currently, we have to write:
  if (a.type === 'a' && b.type === 'a') { return a.p1 === b.p1;  }
  if (a.type === 'b' && b.type === 'b') { return a.p2 === b.p2; }
  return false;

  // But I'd like to be able to write:
  if (a.type !== b.type) { return false; }
  return a.type === 'a' ? a.p1 === b.p1 : a.p2 === b.p2;
}
```

## Use Cases

<!--
What do you want to use this for?
What shortcomings exist with current approaches?
-->

I can't think about other use cases except comparisons (if you know let me know), but I think they're common enough. This will also make them somewhat faster (no need to check both's type).

## Checklist

My suggestion meets these guidelines:

* [x] This wouldn't be a breaking change in existing TypeScript/JavaScript code
* [x] This wouldn't change the runtime behavior of existing JavaScript code
* [x] This could be implemented without emitting different JS based on the types of the expressions
* [x] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)
* [x] This feature would agree with the rest of [TypeScript's Design Goals](https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals).
Repository: pytorch
Issue: When I use cuda(), wg = th.matmul(extra_obs, extra_obs.transpose(-2, -1)) take a mistake
Labels: triaged,module: cublas

there is the error, RuntimeError: cublas runtime error : the GPU program failed to execute at /pytorch/aten/src/THC/THCBlas.cu:411
it is ok when I run on cpu().

cuda9.0  torch 0.4.1

cc @csarofeen @ptrblck
Repository: TypeScript
Issue: `RegExp.lastIndex` has no doc comment in `lib.es5.d.ts`
Labels: Bug,Help Wanted,Domain: lib.d.ts

<!-- 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨

Half of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker.

Please help us by doing the following steps before logging an issue:
  * Search: https://github.com/Microsoft/TypeScript/search?type=Issues
  * Read the FAQ, especially the "Common Feature Requests" section: https://github.com/Microsoft/TypeScript/wiki/FAQ

-->

## Search Terms

"lastIndex"

## Suggestion

`RegExp.lastIndex` should have a doc comment - you can see it lacks one here: https://github.com/microsoft/TypeScript/blob/7fc456f2d70348725bbef92732b98a33c07f85ad/lib/lib.es5.d.ts#L944

MDN doc for the property can be found [here](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/lastIndex).
Repository: rust
Issue: Make lang items private
Labels: C-enhancement,T-compiler,A-lang-item

#72170 and #72216 put some effort in to try and prevent some potential ICEs that can occur in `#![no_core]` due to how we currently reference lang items.

@oli-obk pointed out:

> Oh, that's a very good idea. I wonder if we can make `lang_items` private at some point and just have sensible wrappers like `require_lang_item`.

I'm opening this issue to start a discussion about how we could take this forward.

<!-- TRIAGEBOT_START -->

<!-- TRIAGEBOT_ASSIGN_START -->

<!-- TRIAGEBOT_ASSIGN_DATA_START$${"user":null}$$TRIAGEBOT_ASSIGN_DATA_END -->

<!-- TRIAGEBOT_ASSIGN_END -->
<!-- TRIAGEBOT_END -->
Repository: pytorch
Issue: tensorboard projector mode with custom metadata_header with only one label name
Labels: triaged,module: tensorboard

## 🐛 Bug

`.add_embeddings(metadata_header=['some-name'])` breaks the tensorboard to parse the metadata. Reaching http://localhost:6006/#projector shows the error

```
Error merging metadata
Number of tensors (20) do not match the number of lines in metadata (21). Single column metadata should not have a header row.
```

![Bildschirmfoto vom 2020-05-15 20-23-22](https://user-images.githubusercontent.com/7688337/82083388-f3cbfd80-96e9-11ea-9f0a-c5e11a11c05c.png)

## To Reproduce

```python
import torch
from torch.utils.tensorboard import SummaryWriter
mat = torch.randn(20, 10)
units = torch.arange(20).unsqueeze(1).tolist()
writer = SummaryWriter('runs/example')
writer.add_embedding(mat, units, metadata_header=['unit'])
writer.close()
```
Then navigate to localhost:6006 in a browser.

Note: using the default `metadata_header` does not break tensorboard to parse the metadata file.

## Expected behavior

A browser opens Projector tab and shows the data in PCA space.

## Environment

PyTorch version: 1.5.0
Is debug build: No
CUDA used to build PyTorch: None

OS: Ubuntu 18.04.4 LTS
GCC version: (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
CMake version: version 3.10.2

Python version: 3.8
Is CUDA available: No
CUDA runtime version: No CUDA
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA

Versions of relevant libraries:
[pip] numpy==1.18.1
[pip] torch==1.5.0
[pip] torchvision==0.6.0a0+82fd1c8
[pip] tensorboard==2.2.1
[conda] blas                      1.0                         mkl  
[conda] cpuonly                   1.0                           0    pytorch
[conda] mkl                       2020.1                      217  
[conda] mkl-service               2.3.0            py38he904b0f_0  
[conda] mkl_fft                   1.0.15           py38ha843d7b_0  
[conda] mkl_random                1.1.0            py38h962f231_0  
[conda] numpy                     1.18.1           py38h4f9e942_0  
[conda] numpy-base                1.18.1           py38hde5b4d6_1  
[conda] pytorch                   1.5.0               py3.8_cpu_0  [cpuonly]  pytorch
[conda] torchvision               0.6.0                  py38_cpu  [cpuonly]  pytorch

## Additional context

If it's a bug on tensorflow/tensorboard side, let me know to move the issue there.

The `metadata.tsv` file has 21 lines because it starts with the label name:

```
unit
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
```

-------
Update

>  Single column metadata should not have a header row.

makes me think that it's done by design. If so, 

1) it's not user friendly. How do I change `label` -> `unit` in the viewer then?
2) I'd like to receive the error during `.add_embeddings()` rather than ignoring it silently and then realizing something wrong has happened only when you open a browser.
Repository: go
Issue: x/pkgsite: support removing packages in the top-level module, but not in nested modules
Labels: NeedsFix,FeatureRequest,pkgsite

### What is the URL of the page with the issue?
 https://pkg.go.dev/mod/go.opentelemetry.io?tab=packages
 
### What did you do?
 
Initially using https://github.com/GoogleCloudPlatform/govanityurls.git we publish modules directly under `go.opentelemetry.io` but later because we found that we will have more repos we decided to use different paths to export different repositories

```yaml
/otel:
  repo: https://github.com/open-telemetry/opentelemetry-go
/collector:
  repo: https://github.com/open-telemetry/opentelemetry-collector
/contrib/otel:
  repo: https://github.com/open-telemetry/opentelemetry-go-contrib
/contrib/collector:
  repo: https://github.com/open-telemetry/opentelemetry-collector-contrib
```
 
Before we had (which we replaced 6 moths ago, and never used):
```yaml
/:
  repo: https://github.com/open-telemetry/opentelemetry-go
```

### What did you expect to see?

I would expect all the old packages that we exported previously https://pkg.go.dev/mod/go.opentelemetry.io?tab=packages to be gone.
 
 
### What did you see instead?

I would expect to have only packages under https://pkg.go.dev/mod/go.opentelemetry.io/otel?tab=packages
Repository: pytorch
Issue: [quantization] Version support for quantization BC tests
Labels: oncall: quantization,low priority,triaged

The quantization BC tests (https://github.com/pytorch/pytorch/blob/master/test/quantization/test_backward_compatibility.py) currently only have one serialized model per class type/dtype, however some of the quantized modules have gone through several revisions, with version counter bumps (e.g. https://github.com/pytorch/pytorch/blob/dc918162b7cbf5a81b946780a985b00df4795baf/torch/nn/quantized/modules/linear.py#L11). We should add versioning support to the BC tests to make sure that all versions of the serialized modules are supported as we keep developing the code

cc @jerryzh168 @jianyuh @raghuramank100 @vkuzo @jgong5 @Xia-Weiwen @leslie-fang-intel @dzhulgakov @jamesr66a
Repository: vscode
Issue: [html] don't let '/' trigger a suggest in embedded JavaScript
Labels: feature-request,html


Issue Type: <b>Bug</b>

Create and save a new .html file.  Add a script tag, such as:

```
<script>
    function main() {
        /**/
    }
</script>
```

You will notice that after typing the closing slash, IntelliSense pops up (leading to potential unintended insertions if Enter is pressed, for example).  If the identical JavaScript code is put into a .js file, the behavior does not occur.

VS Code version: Code 1.45.1 (5763d909d5f12fe19f215cbfdd29a91c0fa9208a, 2020-05-14T08:27:35.169Z)
OS version: Windows_NT x64 10.0.18363

<details>
<summary>System Info</summary>

|Item|Value|
|---|---|
|CPUs|Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz (8 x 2808)|
|GPU Status|2d_canvas: enabled<br>flash_3d: enabled<br>flash_stage3d: enabled<br>flash_stage3d_baseline: enabled<br>gpu_compositing: enabled<br>multiple_raster_threads: enabled_on<br>oop_rasterization: disabled_off<br>protected_video_decode: enabled<br>rasterization: enabled<br>skia_renderer: disabled_off_ok<br>video_decode: enabled<br>viz_display_compositor: enabled_on<br>viz_hit_test_surface_layer: disabled_off_ok<br>webgl: enabled<br>webgl2: enabled|
|Load (avg)|undefined|
|Memory (System)|15.86GB (8.52GB free)|
|Process Argv||
|Screen Reader|no|
|VM|0%|
</details><details><summary>Extensions (2)</summary>

Extension|Author (truncated)|Version
---|---|---
vscode-eslint|dba|2.1.5
python|ms-|2020.5.78807


</details>
<!-- generated by issue reporter -->
Repository: godot
Issue: Cyclic dependencies between References, even without any static typing, cause memory leaks / errors on exit
Labels: bug,topic:gdscript

**Godot version:**

3.2.1-stable

**Steps to reproduce:**

Simply have two objects reference each other through properties, for instance by having this script attached to the root node of a scene:

```gdscript
func _ready() -> void:
	var a = A.new()
	var b = B.new()
	a.b = b
	b.a = a

class A:
	var b
	
class B:
	var a
```

Then exit the game. The following errors will be reported in the console:

> ERROR: ~List: Condition "_first != __null" is true.
>    At: ./core/self_list.h:112
> ERROR: ~List: Condition "_first != __null" is true.
>    At: ./core/self_list.h:112
> WARNING: cleanup: ObjectDB Instances still exist!
>      At: core/object.cpp:2071

Note: this is the simplest reproducible example, but **this also occurs if A and B are `class_name`s  in their own scripts**. Then you get all of the previous errors, plus this one:

> ERROR: clear: Resources Still in use at Exit!
>    At: core/resource.cpp:476

If you remove `b.a = a`, then the error disappears, in both cases.

This also happens if you have any longer cycle, e.g. a -> b -> c -> a,

I believe this issue is different from #30668, which is about referencing the current class via a variable, param or return type through static typing. It's also not exactly the same as #21461 since it doesn't prevent the game from running (and doesn't yield any warnings when editing), and happens without having two types explicitly referencing each other.
Repository: TypeScript
Issue: Better intellisense for unions of tuple types
Labels: Suggestion,Awaiting More Feedback

VSCode - Version 1.45.1
Typescript - Version 3.8.3

## Search Terms

intellisense tuple 

## Suggestion

Have the suggestions of unions of tuple types only suggest valid things

## Use Cases

I have a function which takes a 'path' to a property in a fixed object, say the object is like { a: { b: 1 } }, allowed paths are ["a"], or ["a", "b"].

I have some type which generates for me the union of allowed tuples, which is to be the type of the 'path'.

The fixed object the function takes paths in is very large and I don't want to have to remember the names of things, when I use the union, the intellisense correctly identifies if a path is invalid, but when using ctrl + space to get the suggestions, it suggests strings which if used are immediately afterwards recognised as invalid.

## Examples

Consider a type like

`type X = ["A"] | ["A", "B"]`

Then if I write something like `const x: X = []`, when pressing ctrl + space in the array I would like to just be suggested "A" (in fact this is already the behaviour), after filling in "A", if I try to add another element it would just suggest "B", not "A", "B"

## Checklist

My suggestion meets these guidelines:

* [x ] This wouldn't be a breaking change in existing TypeScript/JavaScript code
* [x ] This wouldn't change the runtime behavior of existing JavaScript code
* [x ] This could be implemented without emitting different JS based on the types of the expressions
* [x ] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)
* [x ] This feature would agree with the rest of [TypeScript's Design Goals](https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals).
Repository: flutter
Issue: Shutdown hooks shouldn't crash the tool
Labels: team,tool,a: quality,team-tool

We should probably handle a shutdown hook that throws an exception similarly to how we handle exceptions from signal handlers. See shutdown hook processing here:

https://github.com/flutter/flutter/blob/master/packages/flutter_tools/lib/src/base/process.dart#L118

and signal handler processing here:

https://github.com/flutter/flutter/blob/master/packages/flutter_tools/lib/src/base/signals.dart#L134
Repository: rust
Issue: LLVM can reorder rounding-mode-sensitive float operations outside rounding mode changes in SSE
Labels: A-LLVM,A-codegen,T-compiler,C-bug,A-floating-point

In release mode, this code can break:

```rust
    /// Converts these packed floats to integers via the floor function.
    #[inline]
    pub fn floor_to_i32x4(self) -> I32x4 {
        unsafe {
            x86::_MM_SET_ROUNDING_MODE(x86::_MM_ROUND_DOWN);
            let value = I32x4(x86::_mm_cvtps_epi32(self.0));
            x86::_MM_SET_ROUNDING_MODE(x86::_MM_ROUND_NEAREST);
            value
        }
    }
```

Because `value` can get reordered after all the rounding mode switches. I'm not sure what the right thing to do here is.
Repository: pytorch
Issue: torch.norm p/ord parameter documentation is wrong
Labels: module: docs,triaged

## 📚 Documentation

There are three minor problems in the `torch.norm` docs:
The default value of `torch.norm`'s `p` parameter is `fro`, but at the same time, the table of values for `ord` (Bug 1: mismatch to the parameter name) lists no vector norm for `ord="fro"` (only for `ord=None`) (Bug 2). Finally, the quote signs are wrong (Bug 3).
Repository: svelte
Issue: data passed to animations is always stale
Labels: stale-bot,temp-stale

https://svelte.dev/repl/ddf5358e78144925b47874d8a6a558ff?version=3.22.2

the `animation-js-delay` test uses indexes to delay animations, and asserts based on stale values
will fix with #4742
Repository: flutter
Issue: Stepper buttons use `ColorScheme.primary` instead of inheriting from buttonTheme
Labels: framework,f: material design,has reproducible steps,found in release: 3.3,found in release: 3.6,team-design,triaged-design

Stepper buttons are using primaryColor as button background color instead of accentColor like the rest of the buttons do...
https://stackoverflow.com/questions/53337392/flutter-change-stepper-step-color

Try defining in ThemeData a button like this, it wont work
```
        buttonTheme: ButtonThemeData(
          buttonColor: Colors.yellow[100],
          shape: RoundedRectangleBorder(
            borderRadius: new BorderRadius.circular(15.0),
            //side: BorderSide(color: Colors.brown),
          ),
          padding: EdgeInsets.all(10.0),
        ),
```
<!-- Thank you for using Flutter!

     If you are looking for support, please check out our documentation
     or consider asking a question on Stack Overflow:
      * https://flutter.dev/
      * https://api.flutter.dev/
      * https://stackoverflow.com/questions/tagged/flutter?sort=frequent

     If you have found a bug or if our documentation doesn't have an answer
     to what you're looking for, then fill our the template below. Please read
     our guide to filing a bug first: https://flutter.dev/docs/resources/bug-reports
-->

## Steps to Reproduce

<!-- You must include full steps to reproduce so that we can reproduce the problem. -->

1. Run `flutter create bug`.
2. Update the files as follows: ... <!-- include every file that is different from the template app! -->
3. ... <!-- describe how to reproduce the problem -->

**Expected results:** <!-- what did you want to see? -->

**Actual results:** <!-- what did you see? -->

<details>
  <summary>Logs</summary>

<!--
      Run your application with `flutter run --verbose` and attach all the
      log output below between the lines with the backticks. If there is an
      exception, please see if the error message includes enough information
      to explain how to solve the issue.
-->

```
```

<!--
     Run `flutter analyze` and attach any output of that command below.
     If there are any analysis errors, try resolving them before filing this issue.
-->

```
```

<!-- Finally, paste the output of running `flutter doctor -v` here. -->

```
```

</details>
Repository: flutter
Issue:  flutter doctor --android-licenses may crash if findJavaBinary selects JAVA_HOME instead of AS Java
Labels: platform-android,tool,P2,team-android,triaged-android

```bash
PS D:\Flutter Projects\flutter_quiz> flutter doctor --android-licenses
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
        at com.android.repository.api.SchemaModule$SchemaModuleVersion.<init>(SchemaModule.java:156)
        at com.android.repository.api.SchemaModule.<init>(SchemaModule.java:75)
        at com.android.sdklib.repository.AndroidSdkHandler.<clinit>(AndroidSdkHandler.java:81)
        at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:73)
        at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
        ... 5 more

```
Repository: godot
Issue: Physics2D weird CollisionPolygon2D interaction with 3 consecutive points on the same line
Labels: bug,confirmed,topic:physics

**Godot version:**
tested on 3.2.1 and 3.2.2 beta 2

**OS/device including version:**
tested on OSX

**Issue description:**
When having a CollisionPolygon2D with 3 consecutive points on the same line, interaction with rigid-bodies becomes unstable and janky.

When enabling collision shapes, the middle point on the collision polygon is visible although the colliding object is nowhere near it. (see image)
![image](https://user-images.githubusercontent.com/11915378/82119523-fd0ba780-9787-11ea-9396-dd7e6505c20a.png)

The most apparent effect is that applying torque in that direction will cause the object not to spin (most of the time), while applying torque in the other direction will behave normally

**Steps to reproduce:**
Create a floor from static body with CollisionBodyPolygon2D
Create the floor collision shape as a rectangle from a polygon using 5 points (1 extra point), for example:
PoolVector2Array( 64, 384, 554, 384, 832, 384, 832, 448, 64, 448 ) 

Create a box with controllable torque that lays on the floor, and try to apply torque in each direction, the box is expected to move, but sometimes it gets "stuck".
make sure to:
- give enough torque (100 torque for 1 weight works for me)
- disable "can sleep" on the box

**Minimal reproduction project:**
attached a minimal reproduction.

A and D keys apply torque to the box
deleting point 1 in the CollisionPolygon2D for floor fixes the issue
[Archive.zip](https://github.com/godotengine/godot/files/4638330/Archive.zip)