sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: pytorch
Issue: [TorchScript Usability] Incorrect default types
Labels: oncall: jit

## 📚 Incorrect default types

When types of variables or instance attributes cannot be automatically inferred, or if  types of parameters, return value, or class attributes are not annotated or inferred, they are given the DefaultType of `Tensor`. There are cases where TorchScript could do a better auto-inference to deduce types (other than assuming the default type). 

**Example 1**
```
import torch
  
def f(a, mask):
  if mask is not None:
    return a + mask
  return a

ones = torch.ones([6])
mine = torch.Tensor([1,2,3,4,5,6])
m = torch.jit.script(f)
print(m(ones, mine))
print(m(ones, None))
```
It issues the following error:
```
python test-is-none.py
tensor([2., 3., 4., 5., 6., 7.])
Traceback (most recent call last):
File "test-is-none.py", line 12, in <module>
print(m(ones, None))
RuntimeError: f() Expected a value of type 'Tensor (inferred)' for argument 'mask' but instead found type 'NoneType'.
Inferred 'mask' to be of type 'Tensor' because it was not annotated with an explicit type.
Position: 1
Value: None
Declaration: f(Tensor a, Tensor mask) → (Tensor)
Cast error details: Unable to cast Python instance to C++ type (compile in debug mode for details)
```

Basically, the default type "tensor" does not capture what the actual type is. And it is a common type of user scripting errors (aka "default type problems"). 

**Example 2**
A commonly employed user pattern (simplified) from a `MultiHeadAttention module` found online.
```
def f(a, mask):
  if mask is not None:
    return a * mask
  return a
```

**Examples 3**
Here's another common paradigm in modules (simplified from `MobileNetV3`):
```
def f2(a, use_se):
  if use_se:
    return a * 2
  return a
```

**Example 4** Incorrect default types of empty list or dictionary

In this case the default type of `Dict[Tensor, Tensor]` or `List[Tensor]` is incorrect (from the context of its usage).

```
@torch.jit.script
def fn1():
    d = {}
    d["foo"] = 1.0

@torch.jit.script
def fn2():
    l = []
    l.append("foo")
```

**Potential solutions**

1. automatically infer `Optional[tensor]` for default types (it would be best effort. We may be able to capture most of the cases, but probably not all of them). 
2. specialize default parameter type based on argument types (this may lead to pathological cases where we may not be able to have enough type information to specialize all necessary types at compile-time). The extreme case is when users do not annotate any types.
3. allow all non-primitive types to be able to be None (closest to Python behavior), but will break current TorchScript semantics (already scripted codes may need to add some None check back if they were removed from original Python codes).

@gmagogsfm @Lilyjjo 


cc @gmagogsfm
Repository: node
Issue: Add `session.currentStreamCount` HTTP/2 property
Labels: http2

**Is your feature request related to a problem? Please describe.**

### Problem 1

Assume the server has a limited count of concurrent streams, e.g. 10. We want to make 100 requests. This code:

```js
const session = http2.connect(...);
const requests = [];

for (let i = 0; i < 100; i++) {
	requests.push(session.request({}, {endStream: false}));
}
```

will fail, because the server can handle only 10 requests at the same time. To fix this, we listen on the `remoteSettings` event.

```js
const session = http2.connect(...);
const requests = [];

session.once('remoteSettings', () => {
	  const {maxConcurrentStreams} = session.remoteSettings;

	  // 1. Do Math.min(maxConcurrentStreams, 100) requests
	  // 2. When one finishes, start another.
});
```

But what if the server decides to close the session without sending us the settings? Then the code will never execute. To fix this, we add the `close` event handler. Unfortunately, we cannot tell if the code was executed or not just by listening on `close`. So we need to add a flag:

```js
const session = http2.connect(...);
const requests = [];

let receivedSettings = false;

session.once('remoteSettings', () => {
	  const {maxConcurrentStreams} = session.remoteSettings;

	  // 1. Do Math.min(maxConcurrentStreams, 100) requests
	  // 2. When one finishes, start another.
});

session.once('close', () => {
	if (!receivedSettings) {
		emitter.emit('error', new Error('Session closed unexpectedly'));
	}
});
```

The flag can be implemented by Node.js - and that would be useful.

### Problem 2

So the session is already running, and there are some requests pending. How do we know how many requests we can do? Well, we don't. There's no property that tells us how many streams there are.

**Describe the solution you'd like**

* `session.currentStreamCount`
* `session.receivedRemoteSettings`

**Describe alternatives you've considered**

As of now I'm applying a workaround to calculate the properties above on my own.
Repository: flutter
Issue: Figures out the correct type for linux in accessibility library
Labels: engine,a: accessibility,platform-linux,P2,team-engine,triaged-engine

In order to pass the linting, currently we use placeholder `void *` to define accessibility type in third_party/accessibility/gfx/native_widget_types.h

```
typedef void* NativeCursor;

...

typedef void* AcceleratedWidget;
constexpr AcceleratedWidget kNullAcceleratedWidget = nullptr;
```

We should figure out what is the right type to use
Repository: flutter
Issue: integration_test embedded in shipping iOS apps when added to pubspec
Labels: a: tests,platform-ios,tool,f: integration_test,P2,team-ios,triaged-ios

@matanlurey update as of 2024-11-20:

As of HEAD today, with the following feature flag opt-in:

```sh
flutter config explicit-package-dependencies
```

The generated `.flutter-plugins-dependencies` file now includes `dev_dependency: true|false` per plugin. See <https://github.com/flutter/flutter/pull/158009> for implementation details. We should be able to use the explicit appearance of `dev_dependency: true` in order to strip out plugins (such as `integration_test`) that are dev dependencies in production builds.

---

_Original post_:

`integration_test` was added to the pubspec template in https://github.com/flutter/flutter/pull/70240.  This caused all newly `flutter create`d iOS apps to ship with an embedded `integration_test` framework, and it requires all developers to install CocoaPods, even if they had not previously used any plugins.  It also embedded the app in add-to-app host apps.

https://github.com/flutter/flutter/pull/70240 was reverted in https://github.com/flutter/flutter/pull/74068 due to NNBD issues.  Before it is relanded, there should be a plan for how to prevent the above.

See also https://github.com/flutter/flutter/issues/68818
Repository: flutter
Issue: Handle screen dpr correctly in accessibility library
Labels: engine,a: accessibility,a: desktop,P2,team-macos,triaged-macos

We calculate the accessibility rect in accessibility library assuming the screen dpr is 1.0. It should get the dpr flutter engine in embedding apply it to the transform
Repository: go
Issue: proposal: x/net/dns/dnsmessage: add support for SVCB and HTTPS records
Labels: Proposal

The new SVCB/HTTPS record has been added in iOS 14 and macOS 11. It would be handy to be able to parse them. The RFC is still a draft though.

https://tools.ietf.org/html/draft-ietf-dnsop-svcb-https-01
Repository: go
Issue: runtime: enable scheduler randomization independent of the race detector
Labels: NeedsInvestigation,FeatureRequest,compiler/runtime

`-race` does scheduler randomization. This has proved to be a useful way to flush out logical races, bad lock orderings, etc.

However, running with the race detector enabled (a) is slow and (b) is only supported on a subset of platforms.

I propose that we make it possible to run with scheduler randomization enabled, independent of whether the race detector is enabled.

I believe that this could be done entirely at run time, perhaps via a GODEBUG flag.

cc @dvyukov @bradfitz @aclements @mknyszek
Repository: neovim
Issue: GetPythonIndent error: indent ':' error after a function which return a dict
Labels: bug

<!-- Before reporting: search existing issues and check the FAQ. -->

- `nvim --version`: NVIM v0.5.0-dev+1037-gd6d4e3d1a
- `vim -u DEFAULTS` (version: ) behaves differently? yes
- Operating system/version: Archlinux
- Terminal name/version:
- `$TERM`: xterm-256color

`indentexpr=GetPythonIndent(v:lnum) ` bug

### Steps to reproduce using `nvim -u NORC`

```
nvim -u NORC test.py
```
and type 
```
def test(a, b):
    return {
        "a":a,
        "b":b,
    }

def test2(|):
    return None
```

when type `a:int` in `|`, it will auto indent the function to right...


### Actual behaviour

![image](https://user-images.githubusercontent.com/9934258/105123103-75461c00-5b12-11eb-84c2-273732ae3004.png)

### Expected behaviour

![image](https://user-images.githubusercontent.com/9934258/105123137-87c05580-5b12-11eb-9a43-c9b0ca6ae1de.png)
Repository: vscode
Issue: Can't update the collapse state in the references-viewlet
Labels: under-discussion,references-viewlet

<!-- ⚠️⚠️ 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. -->
I'm developing extensions with the references-viewlet API and meet a problem. The API has only `setInput()` method to set the `SymbolTreeInput` of the reference view. 

Since a `TreeItem` could keep the collapse state (if I understand correctly), if the new `SymbolTreeInput` contains some items the same as the previous one, and the user did some changes in these items about the collapse state such as expand or collapse, the collapse state will be preserved and not apply the state from the new `SymbolTreeInput` in the new reference viewlet, as the screenshot shows.
![ref](https://user-images.githubusercontent.com/45906942/105140255-62dbda80-5b32-11eb-9d42-fe919b343494.gif)

In the screenshot, I trigger `setInput()` to set a new `SymbolTreeInput` by clicking the menu `Base on this type`. In the new `SymbolTreeInput`, The collapse state of the item `PetType` is set to `collapsed`, but it doesn't work.

It could be great if the references-viewlet API offers a method to dispose the treeView. Any other workaround would be appreciated.
Repository: flutter
Issue: InputDecoration doesn't have the ability to increase space between the label and input text/hint
Labels: a: text input,framework,f: material design,has reproducible steps,found in release: 2.5,found in release: 2.6,team-design,triaged-design

The old solution seams to be:
```
contentPadding: EdgeInsets.only(top: 100),
```
but that adds padding on top of the label instead of in between.

Looks like someones made the content padding to also be around the label so now you can't increase the top padding to increase the gap between the label and input text.
In my build of Flutter:
![image](https://user-images.githubusercontent.com/7506155/105141469-ed2d3a00-5b44-11eb-9d01-26993ba2d0d7.png)

With the Flutter version used in the dev docs: https://api.flutter.dev/flutter/material/InputDecoration-class.html it behaves correctly.
![image](https://user-images.githubusercontent.com/7506155/105141219-8e67c080-5b44-11eb-8c1e-1c5de090e700.png)


## Steps to Reproduce
run the following as a decoration of a Text Field
```
InputDecoration(
    labelText: "Label Not Set",
    labelStyle: TextStyle(
      fontSize: 13,
      height: 1.2,
    ),
    contentPadding: EdgeInsets.only(top: 16),
    hintText: "Hint Lable Not Set",
    hintStyle: TextStyle(
      fontSize: 16,
      height: 1.2
    ),
  );

```

## Flutter Doctor
[√] Flutter (Channel unknown, 1.22.3, on Microsoft Windows [Version 10.0.18363.1316], locale en-AU)
    • Flutter version 1.22.3 at C:\Users\zach\fvm\default
    • Framework revision 8874f21e79 (3 months ago), 2020-10-29 14:14:35 -0700
    • Engine revision a1440ca392
    • Dart version 2.10.3

 
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at C:\Users\zach\AppData\Local\Android\sdk
    • Platform android-29, build-tools 29.0.2
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
    • All Android licenses accepted.

[!] Android Studio (version 4.1.0)
    • Android Studio at C:\Program Files\Android\Android Studio
    X Flutter plugin not installed; this adds Flutter specific functionality.
    X Dart plugin not installed; this adds Dart specific functionality.
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[√] VS Code (version 1.52.1)
    • VS Code at C:\Users\zach\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.18.1

[√] Connected device (1 available)
    • AOSP on IA Emulator (mobile) • emulator-5554 • android-x86 • Android 9 (API 28) (emulator)

Ignore the two fails - that just happens to be an issue where FD doesn't pick up the plugins even though the VS Code is 100% happy.
Repository: flutter
Issue: [google_sign_in] java.lang.NullPointerException: Attempt to read from field [...] on a null object reference
Labels: c: crash,platform-android,p: google_sign_in,package,a: production,P2,c: fatal crash,team-android,triaged-android

I found a following stack trace in my team's Crashlytics:

```
Fatal Exception: java.lang.NullPointerException: Attempt to read from field 'io.flutter.plugin.common.MethodChannel$Result io.flutter.plugins.googlesignin.GoogleSignInPlugin$Delegate$PendingOperation.result' on a null object reference
       at io.flutter.plugins.googlesignin.GoogleSignInPlugin$Delegate.finishWithSuccess(GoogleSignInPlugin.java:2)
       at io.flutter.plugins.googlesignin.GoogleSignInPlugin$Delegate.onSignInAccount(GoogleSignInPlugin.java:69)
       at io.flutter.plugins.googlesignin.GoogleSignInPlugin$Delegate.onSignInResult(GoogleSignInPlugin.java:8)
       at io.flutter.plugins.googlesignin.GoogleSignInPlugin$Delegate.access$000(GoogleSignInPlugin.java)
       at io.flutter.plugins.googlesignin.GoogleSignInPlugin$Delegate$1.onComplete(GoogleSignInPlugin.java:2)
       at com.google.android.gms.tasks.zzj.run(zzj.java:23)
       at android.os.Handler.handleCallback(Handler.java:883)
       at android.os.Handler.dispatchMessage(Handler.java:100)
       at com.google.android.gms.internal.tasks.zzb.dispatchMessage(zzb.java)
       at android.os.Looper.loop(Looper.java:237)
       at android.app.ActivityThread.main(ActivityThread.java:8167)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)
```

One occurrence, app with ~1000 active users.

I had a quick look at the plugin's code in the location mentioned in the stack trace. `result` is passed  through a few layers without a `null`-check. Maybe there's a reasonable (but rare) path when it actually can be `null`?
Repository: go
Issue: cmd/link: -buildmode=c-shared not supported on windows/arm
Labels: OS-Windows,NeedsInvestigation,FeatureRequest,arch-arm,compiler/runtime

<!--
Please answer these questions before submitting your issue. Thanks!
For questions please use one of our forums: https://github.com/golang/go/wiki/Questions
-->

### What version of Go are you using (`go version`)?

<pre>
$ go version 1.15.6

</pre>

### Does this issue reproduce with the latest release?
yes


### What operating system and processor architecture are you using (`go env`)?

<details><summary><code>go env</code> Output</summary><br><pre>
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/vsts/.cache/go-build"
GOENV="/home/vsts/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/vsts/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/vsts/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/opt/hostedtoolcache/go/1.15.6/x64"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/opt/hostedtoolcache/go/1.15.6/x64/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build442356246=/tmp/go-build -gno-record-gcc-switches"

</pre></details>

### What did you do?
I try to cross-compile a Go-library for windows/arm and windows/arm64 to P/Invoke it from .Net. Although Go states to support "windows/arm" as a build target this is not true for buildmode=c-shared.



### What did you expect to see?
windows/arm being supported.


### What did you see instead?
"-buildmode c-shared not supported for windows/arm"
Repository: flutter
Issue: Slider skip some onChange on divisions when fast movement
Labels: framework,f: material design,has reproducible steps,found in release: 2.5,found in release: 2.6,team-design,triaged-design

## Steps to Reproduce

I want to add data to model with slider. The problem that onChange do not triggers by fast slider movement. On slider I am seeing that slider was moved to 7 divisions, but in console I am seeing only 5 actions.

code:
```
Slider(
  value: _currentSliderValue,
  min: 0,
  max: 16,
  divisions: 16,
  label: _currentSliderValue.round().toString(),
  onChanged: (double value) {
    if(_currentSliderValue < value) {
      context.read<JobModelList>().add(JobModel(cmd_args: "some", number: 1) );
      print("plus one");
    }
    if(_currentSliderValue > value) {
      print("minus one");
      context.read<JobModelList>().removeLast();
    }
      
    setState(() {
     _currentSliderValue = value;
    });            
  },     
),
```
I am using Flutter for Web:
```
flutter --version
Flutter 1.25.0-8.3.pre • channel beta • https://github.com/flutter/flutter.git
Framework • revision 5d36f2e7f5 (5 days ago) • 2021-01-14 15:57:49 -0800
Engine • revision 7a8f8ca02c
Tools • Dart 2.12.0 (build 2.12.0-133.7.beta)
```
**Expected results:** 
`onChange` trigger on every division.

**Actual results:** 
https://i.stack.imgur.com/Ir5yC.png

The issue happens only on fast slider drugging.
Repository: pytorch
Issue: Link to `torch.einsum` in `torch.tensordot`
Labels: module: docs,triaged

## 📚 Documentation
Currently the documentation of [`torch.tensordot`][1] is quite comprehensible.
However, I came across several instances recently (e.g., [a][2], [b][3], [c][4]) where users tried to "push" `tensordot` beyond its capabilities while being completely unaware of the functionality provided by `torch.einsum`.

Is it possible to add "see also" part at the bottom of `tensordot` documentation linking to `einsum`? 

For example, in [`numpy.tensordot`][5] documentation there is a "see also" part that links to `einsum`:

![image](https://user-images.githubusercontent.com/1818351/105165929-9bbe8400-5b1f-11eb-9144-cdc5c73ed2db.png)

Can we have similar section in pytorch as well, please?

 [1]: https://pytorch.org/docs/stable/generated/torch.tensordot.html#torch.tensordot
 [2]: https://stackoverflow.com/q/65797216/1714410
 [3]: https://stackoverflow.com/q/65716540/1714410
 [4]: https://stackoverflow.com/q/51266507/1714410
 [5]: https://numpy.org/doc/stable/reference/generated/numpy.tensordot.html#numpy.tensordot

<!-- A clear and concise description of what content in https://pytorch.org/docs is an issue. If this has to do with the general https://pytorch.org website, please file an issue at https://github.com/pytorch/pytorch.github.io/issues/new/choose instead. If this has to do with https://pytorch.org/tutorials, please file an issue at https://github.com/pytorch/tutorials/issues/new -->


cc @jlin27 @mruberry
Repository: pytorch
Issue: Segmentation fault encountered when using nn.MultiheadAttention with v1.7.1
Labels: module: crash,triaged,module: regression

## 🐛 Bug

Calling the forward method of an instance of `nn.MultiheadAttention` results in either a segmentation fault or `free(): invalid pointer. Aborted (core dumped)` error.

For me, this module worked fine for me for v1.6 and earlier, but gives this error on v1.7.1

## To Reproduce

Steps to reproduce the behavior:

```
mha = nn.MultiheadAttention(128, 8, dropout=0.1).cuda()
q = k = torch.rand(100, 1, 128).cuda()
v = torch.rand(100, 1, 128).cuda()
output = mha(q, k, value=v)[0]
```

## Expected behavior

Execution should be error-free.

## Environment

```
PyTorch version: 1.7.1
Is debug build: False
CUDA used to build PyTorch: 11.0
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.10.2

Python version: 3.7 (64-bit runtime)
Is CUDA available: True
CUDA runtime version: Could not collect
GPU models and configuration: GPU 0: GeForce RTX 3090
Nvidia driver version: 455.45.01
cuDNN version: Could not collect
HIP runtime version: N/A
MIOpen runtime version: N/A

Versions of relevant libraries:
[pip3] numpy==1.19.5
[pip3] torch==1.7.1
[pip3] torchaudio==0.7.0a0+a853dff
[pip3] torchvision==0.8.2
[conda] blas                      1.0                         mkl    conda-forge
[conda] cudatoolkit               11.0.221             h6bb024c_0  
[conda] libblas                   3.8.0                    21_mkl    conda-forge
[conda] libcblas                  3.8.0                    21_mkl    conda-forge
[conda] liblapack                 3.8.0                    21_mkl    conda-forge
[conda] mkl                       2020.2                      256  
[conda] numpy                     1.19.5           py37haa41c4c_1    conda-forge
[conda] pytorch                   1.7.1           py3.7_cuda11.0.221_cudnn8.0.5_0    pytorch
[conda] torchaudio                0.7.2                      py37    pytorch
[conda] torchvision               0.8.2                py37_cu110    pytorch

```

## Additional context

- The same error occurs when running under the same environment on an RTX2080Ti GPU.
- Execution on CPU is error free.
- Execution on nightly release is also error-free (both CPU and cuda).


cc @zhangguanheng66
Repository: terminal
Issue: Code Health: Cleanup manual StartBringIntoView once fixed in WinUI
Labels: Help Wanted,Product-Terminal,Issue-Task,Area-CodeHealth

As a part of a workaround for https://github.com/microsoft/microsoft-ui-xaml/issues/3945 we have introduced a manual call to `StartBringIntoView` (https://github.com/microsoft/terminal/pull/8832).

We would like to cleanup this code, once the fix is introduced in the TabView.
There is already a PR for the upstream issue here: https://github.com/microsoft/microsoft-ui-xaml/pull/3966.