sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: pytorch
Issue: Mnasnet0_5 first layer shape incorrect
Labels: triaged,module: vision

## 🐛 Bug

Documentation here lays out the code for Mnasnet as used in pytorch: https://pytorch.org/docs/stable/_modules/torchvision/models/mnasnet.html

Running this with alpha = 0.5 results in a depth[0] of 16 but the first layer of mnasnet0_5 has 32, indicating it has been trained with alpha = 1

Output from my pdb:
(Pdb) alpha = 0.5
(Pdb) _get_depths(alpha)
[16, 8, 16, 24, 40, 48, 96, 160]
(Pdb) alpha = 0.6
(Pdb) _get_depths(alpha)
[24, 16, 16, 24, 48, 56, 112, 192]
(Pdb) alpha = 0.8
(Pdb) _get_depths(alpha)
[24, 16, 24, 32, 64, 80, 152, 256]
(Pdb) alpha = 0.9
(Pdb) _get_depths(alpha)
[32, 16, 24, 40, 72, 88, 176, 288]

However mnasnet0_5 has 32 filters in first layer
(Pdb) mnasnet = mnasnet0_5(pretrained=True)
(Pdb) mnasnet.layers[0].weight.shape
torch.Size([32, 3, 3, 3])

Steps to reproduce the behaviour:
See above code.


## Expected behaviour

i would expect mnasnet0_5 to have 16 filters in first layer OR for the code documented at https://pytorch.org/docs/stable/_modules/torchvision/models/mnasnet.html to produce a network with 32 filters in first layer.

## Environment

Please copy and paste the output from our
[environment collection script]Collecting environment information...
PyTorch version: 1.3.1
Is debug build: No
CUDA used to build PyTorch: 10.1.243

OS: Ubuntu 18.04.3 LTS
GCC version: (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0
CMake version: Could not collect

Python version: 3.7
Is CUDA available: Yes
CUDA runtime version: 9.1.85
GPU models and configuration: 
GPU 0: GeForce RTX 2080 Ti
GPU 1: GeForce RTX 2080 Ti

Nvidia driver version: 430.26
cuDNN version: Could not collect

Versions of relevant libraries:
[pip] flashtorch==0.0.7
[pip] numpy==1.17.0
[pip] numpydoc==0.9.1
[pip] torch==1.3.1
[pip] torchsummary==1.5.1
[pip] torchvision==0.4.2
[conda] blas                      1.0                         mkl  
[conda] flashtorch                0.0.7                    pypi_0    pypi
[conda] mkl                       2019.4                      243  
[conda] mkl-service               2.3.0            py37he904b0f_0  
[conda] mkl_fft                   1.0.14           py37ha843d7b_0  
[conda] mkl_random                1.1.0            py37hd6b4f25_0  
[conda] pytorch                   1.3.1           py3.7_cuda10.1.243_cudnn7.6.3_0    pytorch
[conda] torch                     1.2.0                    pypi_0    pypi
[conda] torchsummary              1.5.1                    pypi_0    pypi
[conda] torchvision               0.4.0                    pypi_0    pypi

cc @fmassa
Repository: flutter
Issue: FocusNode change notifier not called when focused TextField is removed
Labels: a: text input,framework,f: material design,customer: octopod,f: focus,has reproducible steps,found in release: 3.0,found in release: 3.1,team-design,triaged-design

The following test will fail the final expect:

```
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';

Widget buildApp(Widget body) {
  return MaterialApp(
    home: Scaffold(
      body: body,
    ),
  );
}

TextField buildTextField(FocusNode focus) {
  return TextField(
    focusNode: focus,
    autofocus: true,
  );
}

main() {
  testWidgets('Focus node dispose', (WidgetTester tester) async {
    final FocusNode focus = FocusNode();
    bool isFocused = focus.hasFocus;
    final VoidCallback focusChanged = () => isFocused = focus.hasFocus;
    focus.addListener(focusChanged);
    expect(isFocused, isFalse);

    await tester.pumpWidget(buildApp(buildTextField(focus)));
    expect(focus.hasFocus, isTrue);
    expect(isFocused, isTrue);

    await tester.pumpWidget(buildApp(Text('No focus')));
    expect(focus.hasFocus, isFalse);
    expect(isFocused, isFalse);
  });
}
```

I believe this violates the contract established by FocusNode's ChangeNotifier interface, since clearly the FocusNode no longer has focus after its TextField is removed.

In our app we expect the change notifier to be called so that we can manage the focus change cleanly. Without this, we need to manage the focus change by chasing down every logic path that can cause the app to rebuild without the text field, which leads to error-prone duplication of code.
Repository: rust
Issue: Irrelevant error caused by illegal blanket impl
Labels: A-diagnostics,T-compiler,C-bug,S-needs-repro

I have a minimal example, using stable rustc 1.39.0:

`Cargo.toml`:
```
[package]
name = "minimal"
version = "0.1.0"
authors = ["Erlend Langseth <3rlend@gmail.com>"]
edition = "2018"


[dependencies]
# Actix
actix = "0.9.0-alpha.2"
actix-web = "2.0.0-alpha.6"
actix-rt = "1.0.0"
actix-http = "1.0.0"


# Redis
redis-async = "0.6.1"
actix-redis = "0.8.0-alpha.1"

# Serde
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
```

`main.rs`:
```
use actix::prelude::*;
use actix_web::{
    get,
    web::{Json, Data},
    App, HttpServer,
};
use serde::{Deserialize};

use redis_async::{
    resp_array,
    resp::{RespValue, FromResp},
    client::paired::PairedConnection as RedisConn
};
use std::str::FromStr;
use std::net::SocketAddr;

#[actix_rt::main]
async fn main() -> std::io::Result<()> {
    let redis = redis_async::client::paired::paired_connect(&SocketAddr::from_str("127.0.0.1:6379").unwrap()).await.unwrap();

    HttpServer::new(move || {
        App::new()
            .wrap(actix_web::middleware::Logger::new(
                "%a \"%r\" Response: %s %b",
            ))
            .data(redis.clone())
            .service(get_health)
    })
    .bind("127.0.0.1:8088")?
    .start()
    .await
}


impl<'a, T: Deserialize<'a>> FromResp for T {
    fn from_resp_int(resp: RespValue) -> Result<T, redis_async::error::Error> {
        unimplemented!()
    }
}

#[get("/admin/v1/health")]
async fn get_health(redis: Data<RedisConn>) -> Json<usize> {
    let res = redis.send::<String>(resp_array!["PING"]).await;
    Json(0)
}
```

It yields this weird error:
```
error[E0283]: type annotations required: cannot resolve `std::string::String: redis_async::resp::FromResp`
  --> src/main.rs:43:21
   |
43 |     let res = redis.send::<String>(resp_array!["PING"]).await;
   |                     ^^^^

error: aborting due to previous error
```

Whereas the real error is `impl<'a, T: Deserialize<'a>> FromResp for T`. If I remove that impl block, it's all fine.
Repository: pytorch
Issue: Slow clip_grad_norm_ because of .item() calls when run on device
Labels: module: performance,module: cuda,triaged,module: norms and normalization

## Issue description

While profiling a slow training process of a quite deep network I got the following results:
![image](https://user-images.githubusercontent.com/1045411/71187912-c96f3480-225e-11ea-85b7-3cca0f34fdad.png)
Given I saw the problem was the `.item()` call would copy the values from the GPU crossing the PCI, I went ahead and built a version that would optimize that.

I replaced:
```python
total_norm = 0.0
for p in parameters:
   param_norm = p.grad.data.norm(norm_type)
   total_norm += param_norm ** norm_type
```
with:
```python
# PERF: We ensure we are all in the same device to avoid the penalty of moving data back and forth.
total_norm = torch.sum(torch.stack([torch.norm(p.grad,norm_type) for p in parameters]) ** norm_type)
```

There I saw quite an improvement:
![image](https://user-images.githubusercontent.com/1045411/71188107-18b56500-225f-11ea-984c-2d37618c2729.png)

But, to my surprise performance was still very bad for a very boilerplate function and the problem is actually the call to `.norm()` function. Which is horribly slow. 

## System Info

PyTorch version: 1.3.1
Is debug build: No
CUDA used to build PyTorch: 10.1

OS: Microsoft Windows 10 Pro
GCC version: Could not collect
CMake version: Could not collect

Python version: 3.7
Is CUDA available: Yes
CUDA runtime version: Could not collect
GPU models and configuration: Could not collect
Nvidia driver version: Could not collect
cuDNN version: Could not collect

Versions of relevant libraries:
[pip] numpy==1.16.5
[pip] numpydoc==0.9.1
[pip] torch==1.3.1
[pip] torchvision==0.4.2
[conda] blas                      1.0                         mkl
[conda] mkl                       2019.4                      245
[conda] mkl-service               2.3.0            py37hb782905_0
[conda] mkl_fft                   1.0.14           py37h14836fe_0
[conda] mkl_random                1.1.0            py37h675688f_0
[conda] pytorch                   1.3.1           py3.7_cuda101_cudnn7_0    pytorch
[conda] torchvision               0.4.2                py37_cu101    pytorch


cc @ngimel @VitalyFedyunin
Repository: PowerToys
Issue: Implement more taskbar customization features with FalconX as a PowerToy
Labels: Idea-New PowerToy,Product-Tweak UI Design

# Summary of the new feature/enhancement

This feature would help users to have more customization options for their taskbars without any dangerous registry editing tools etc. It allows users to position their taskbar icons in the center of the taskbar similar to the dock approach on other OS.

It also allows the user to customize the look and feel of the taskbar's background with options like **transparent** background, **blurred** background or **acrylic** background.

This will bring a lot of joy to some group of users who always look for more ways to customize their desktop experience.

See here:
* Direct link: https://chrisandriessen.nl/web/FalconX.html
* Store link: https://www.microsoft.com/en-us/p/falconx-center-taskbar/9pcmz6bxk8gh?activetab=pivot:overviewtab

I don't know how big of a problem the paid Store release is since the actual tool is open source.

Thanks a lot already

## Examples:

![Demo](https://chrisandriessen.nl/web/img/p1.jpg)
![Demo](https://chrisandriessen.nl/web/img/p2.jpg)
![Demo](https://chrisandriessen.nl/web/img/p5.jpg)
![Demo](https://chrisandriessen.nl/web/img/p4.jpg)
![Demo](https://chrisandriessen.nl/web/img/p3.jpg)
Repository: pytorch
Issue: DataParallel has different tensor copy behavior if batch size = 1
Labels: triaged,module: data parallel

A probable bug:
https://github.com/pytorch/pytorch/blob/master/torch/nn/parallel/data_parallel.py#L149-L150
parallel_apply would splice the data and copy it onto corresponding GPUs (not sure if it uses non_blocking=True under the hood, but maybe it's a good idea!)
If batch_size equals to 1, DP assumes that the data has already been copied onto the first GPU.

A question:
Is it faster to copy the input data onto GPU-0 and then have DP slice and distribute it on all GPUs or keep the input data in RAM and then have DP copy it directly on all GPUs?
Repository: go
Issue: encoding/json: SyntaxError does not have "json:" prefix
Labels: NeedsDecision

It was my understanding that most errors created inside of a standard library package should be prefixed with the package name. For example, the error message for `sql.ErrNoRows` is `errors.New("sql: no rows in result set")`, not `errors.New("no rows in result set")`.

Some errors in the `json` package are returned without a leading prefix. I noticed this because I hit one and it took some digging to figure out where in the codebase the error was actually coming from.

These tests in scanner_test.go check that the error matches a SyntaxError without a leading prefix. 

```go
var indentErrorTests = []indentErrorTest{
	{`{"X": "foo", "Y"}`, &SyntaxError{"invalid character '}' after object key", 17}},
	{`{"X": "foo" "Y": "bar"}`, &SyntaxError{"invalid character '\"' after object key:value pair", 13}},
}

func TestIndentErrors(t *testing.T) {
	for i, tt := range indentErrorTests {
		slice := make([]uint8, 0)
		buf := bytes.NewBuffer(slice)
		if err := Indent(buf, []uint8(tt.in), "", ""); err != nil {
			if !reflect.DeepEqual(err, tt.err) {
				t.Errorf("#%d: Indent: %#v", i, err)
				continue
			}
		}
	}
}
```

Is that right? Shouldn't those error messages have a leading "json:" prefix?
Repository: pytorch
Issue: Disable PSIMD? Why Pytorch is trying to download PSimd when PSIMD_SOURCE_DIR is defined?
Labels: module: build,triaged

Can I disable PSimd during installation of Pytorch from source? Why is Pytorch trying to download PSimd to /pytorch/build/confu-srcs/psimd even when PSIMD_SOURCE_DIR is defined? PSimd is already in third_party packages, hence makes no sense why downloading is necessary? These options do not disable PSimd:

`BUILD_CAFFE2_OPS=0 USE_NNPACK=0 USE_QNNPACK=0 USE_PYTORCH_QNNPACK=0`
Repository: electron
Issue: Memory leak when opening and closing windows
Labels: 11-x-y

### Issue Details

* **Electron Version:**
  * 5, 6, 7, 8
* **Operating System:**
  * Windows 10
* **Last Known Working Electron version:**
  * ?

### Expected Behavior
Opening and closing window should not increase memory

### Actual Behavior
Memory will increase for each window even after the window has been destroyed

### To Reproduce
```
const { app, BrowserWindow, BrowserView } = require("electron");

const init = () => {
	let browserWindow2 = new BrowserWindow({
		show: true,
	});
	let j = 0;
	const interval = setInterval(() => {
		j++;
		if (j > 10) {
			clearInterval(interval);
		}
		for(let i = 0; i < 20; i++) {
			let browserWindow = new BrowserWindow({
				show: true,
			});
			setTimeout(() => {
				browserWindow.close();
			}, 5000)
		}
	}, 1000);

};
app.on("ready", () => {
	init();
});
```
The above code snipped should not result in more memory than just opening a single window.
I also tried to call the garbage collector manually and I also tried browserWindow.destroy(). No difference.
Repository: flutter
Issue: BouncingScrollPhysics has an enormous fling velocity limit
Labels: platform-ios,framework,a: fidelity,f: scrolling,c: proposal,P2,team-framework,triaged-framework

I have tried using `BouncingScrollPhysics` and found out that it has just an enormously huge limit of max repeating fling velocity. This is important for me because I have a long list in my application (it's songs list and it is for like 400 songs on my device). 

This is the piece of code that found that I guess cares about this behaviour
```dart
@override
double carriedMomentum(double existingVelocity) {
    return existingVelocity.sign *
        math.min(0.000816 * math.pow(existingVelocity.abs(), 1.967).toDouble(), 40000.0);
}

```

The thing is that with such a huge velocity limit I can jump through the entire 400-count items list with just 3 flings! And of course it causes fps drops like to 15, because my list widgets are quite heavy and contain stream builders, animations and images

I asked my friend to open some system native iOS app to test it out, fling with max rate he can. And actually it seems to be a lot more slower than it is in flutter.

[Video](https://youtu.be/WmRnpnjv4UU) - an iOS native fling (60fps)
[Video](https://youtu.be/3Tl73C9PE50) - default flutter 40000 limit (30fps)
[Video](https://youtu.be/7PjAT-FuNyw) - 20000 limit - seems to me at least a little bit more closer to native (30fps)

Of course I have not measured this accurately, frame-by-frame. This limit just seems to me too large number
Repository: go
Issue: encoding/json: the Decoder.Decode API lends itself to misuse
Labels: NeedsDecision

I'm observing the existence of several production servers that are buggy because the `json.Decoder.Decode` API lends itself to misuse.

Consider the following:
```go
r := strings.NewReader("{} bad data")

var m map[string]interface{}
d := json.NewDecoder(r)
if err := d.Decode(&m); err != nil {
	panic(err) // not triggered
}
```

`json.NewDecoder` is often used because the user has an `io.Reader` on hand or wants to configure some of the options on `json.Decoder`. However, the common case is that the user only wants to decode a *single* JSON value. As it stands the API does not make the common case easy since `Decode` is designed with the assumption that the user will continue to decode more JSON values, which is rarely the case.

The code above executes just fine without reporting an error and silently allows the decoder to silently accept bad input without reporting any problems.
Repository: terminal
Issue: Don't printf wstring_views by copying them into wstrings; use `%.*s`!
Labels: Product-Conhost,Help Wanted,Product-Terminal,Issue-Task,Area-CodeHealth

`StringCchPrintf` and--since C99--`printf` support a specifier that indicates that a string is counted:

```
auto size = /* ... */;
auto data = /* ... */;
printf("%.*s", size, data);
```

The `.*` suggests that printf should consume one register-width argument to determine how many characters the string that follows contains instead of waiting for a null terminator.
Repository: go
Issue: x/build/cmd/coordinator: runSubrepoTests (golang.org/x repo tests) should also check maxTestExecErrors constant
Labels: Builders,NeedsFix,FeatureRequest

In my investigation at https://github.com/golang/go/issues/35581#issuecomment-567275354, I wrote:

> It is intentional to keep retrying "communications failures" forever, because the expectation is that they should eventually succeed.

I'm seeing now that this isn't quite true. There is a constant defined:

```
// maxTestExecError is the number of test execution failures at which
// we give up and stop trying and instead permanently fail the test.
// Note that this is not related to whether the test failed remotely,
// but whether we were unable to start or complete watching it run.
// (A communication error)
const maxTestExecErrors = 3
```

The `runTestsOnBuildlet` method, which is called by `runTests` method, has block that checks if `ti.numFail` has reached `maxTestExecErrors`:

```Go
if err != nil {
	bc.MarkBroken() // prevents reuse
	for _, ti := range tis {
		ti.numFail++
		st.logf("Execution error running %s on %s: %v (numFails = %d)", ti.name, bc, err, ti.numFail)
		if err == buildlet.ErrTimeout {
			ti.failf("Test %q ran over %v limit (%v); saw output:\n%s", ti.name, timeout, execDuration, buf.Bytes())
		} else if ti.numFail >= maxTestExecErrors {
			ti.failf("Failed to schedule %q test after %d tries.\n", ti.name, maxTestExecErrors)
		} else {
			ti.retry()
		}
	}
	return
}
```

However, the `runTests` method is only used for the main Go repository, not golang.org/x repos:

```Go
if st.IsSubrepo() {
	remoteErr, err = st.runSubrepoTests()
} else {
	remoteErr, err = st.runTests(st.getHelpers())
}
```

So this bug is about making the golang.org/x repos path also use the `maxTestExecErrors` constant and give up after some number of tries.

It's low value to fix because we rarely run into a situation where communication errors happen 3 times or more; that happens most often due to other bugs which we need to fix anyway.

/cc @bradfitz @cagedmantis @toothrot
Repository: nvm
Issue: Add "rm" alias for "uninstall"
Labels: feature requests

As a developer more regularly engaged with `npm`'s command aliases, I would like a way to use the same kinds of shortened syntax with `nvm`. For example:

 - `npm i` == `npm install`
 - `npm rm` == `npm uninstall`
 - etc.

It seems odd to me that `nvm` doesn't consistently use long- or short-form verbs for commands in the documentation. For example:

 - `nvm ls` instead of `nvm list`
 - `nvm uninstall` instead of `nvm rm` (`nvm rm` doesn't even work)

How can I get better command consistency with `nvm`? I'd be happy to consider working on PR for this, but I don't know where to start.
Repository: ant-design
Issue: Custom line in Tree's showLine
Labels: Inactive

- [x] I have searched the [issues](https://github.com/ant-design/ant-design/issues) of this repository and believe that this is not a duplicate.

### What problem does this feature solve?
In `Tree` Component, currently I can set `showLine` to show the line, but I can't customize this line's style.



### What does the proposed API look like?
It will be awesome if you can add a property =>  `line: React.ReactNode` in `Tree`


<!-- generated by ant-design-issue-helper. DO NOT REMOVE -->
Repository: flutter
Issue: Callback to be ran when StreamBuilder rebuilds?
Labels: c: new feature,framework,c: proposal,P3,team-framework,triaged-framework

<!-- 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
-->

## Use case

I want to start an animation when my `StreamBuilder` rebuilds. This can be done in regular stateful widgets by overriding `didUpdateWidget`.

`didUpdateWidget` _does_ run when the `StreamBuilder` rebuilds, but there's no way to check if the update was caused by the `StreamBuilder`.

## Proposal

<!--
     Briefly but precisely describe what you would like Flutter to be able to do.

     Consider attaching images showing what you are imagining.

     Does this have to be provided by Flutter directly, or can it be provided
     by a package on pub.dev/flutter? If so, maybe consider implementing and
     publishing such a package rather than filing a bug.
-->

I propose a new callback parameter gets added to `StreamBuilder` that gets called when new stream data is received.

This would allow us to start animations when the `StreamBuilder` rebuilds.
Repository: flutter
Issue: Typography().dense and TextBaseline.ideographic cannot work with Chinese?
Labels: engine,a: internationalization,a: typography,has reproducible steps,P2,found in release: 3.3,found in release: 3.7,team-engine,triaged-engine

Typography().dense and TextBaseline.ideographic cannot work with Chinese? 
When I write a widget, just like this:
```dart
Row(crossAxisAlignment: CrossAxisAlignment.center, mainAxisSize: MainAxisSize.max, children: [
   Text('我是中文'), Spacer() ,Text('123456'),
])
```
The first `Text` and the second `Text` cann't be vertically centered，The Chinese font's offset will be lower than number or english. Although, I apply Typography().dense to the AppTheme, also set 'TextBaseline.ideographic' to text, but still cannot work well. What should I do ? Is it a bug? Thank you for your answer.
Repository: opencv
Issue: OE-30 "Color Calibration" Discussion
Labels: evolution

Please see https://github.com/opencv/opencv/wiki/OE-30.-Color-Calibration
I think we need to:

- Create a function that will robustly find common MacBeth charts (allowing for partial occlusion of hands holding the corners) and their homography
   - [This one](https://www.bhphotovideo.com/c/product/1014557-REG/dgk_color_tools_dkk_set_of_2_dkk_poly_bag_2.html/?ap=y&ap=y&smp=y&smp=y&lsft=BI%3A514&gclid=CjwKCAiA3OzvBRBXEiwALNKDP9L-mJu6IEZO3qlDo4SD_CHNb6MevNkPl4AuVk5dxSzfcrYr2IhghRoC4bcQAvD_BwE)
   - and the [standard one](https://www.edmundoptics.com/p/large-x-rite-colorchecker/4243?gclid=CjwKCAiA3OzvBRBXEiwALNKDPy5GoLSCEXkDR5sDTSyf5GnrYpKjdcMKPqIIvISZ_ljhwD8_WLjXWxoCx9YQAvD_BwE)
- Rectify the chart and find each color value in order (detecting partial occlusion of say hands holding he corners)
- Apply a color correction algorithm
   - [Linear correction matrix](http://www.imatest.com/docs/colormatrix/)
   - [More extensive list of linear and polynomial corrections](http://im.snibgo.com/col2mp.htm)

See the wikipedia on [Macbeth ColorChecker charts](https://en.wikipedia.org/wiki/ColorChecker)