sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: rust
Issue: Associated constants inside array repeat expression don't use implied bounds from impl header during well-formedness checking
Labels: A-trait-system,A-associated-items,C-bug,S-has-mcve,T-types,A-implied-bounds

I tried this code: ([try it in a playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=a8d76b8c3e6d1d90ef67b26b8b26af88))

```rust
use std::hash::BuildHasher;
use std::collections::HashMap;

trait H: Send + Sync + Clone + BuildHasher { }

struct I<'i, RS: H> {
    h: &'i HashMap<i32, i32, RS>,
    s: VeryVeryLongTypeName
}
impl<'i, RS: H> I<'i, RS> {
    const CHUNK_SIZE: usize = VeryVeryLongTypeName::CHUNK_SIZE;
    fn go(&mut self) {
        self.s.chunks.push(Box::new([0; Self::CHUNK_SIZE])); // ERROR
    }
}

struct VeryVeryLongTypeName {
    chunks: Vec<Box<[u8; Self::CHUNK_SIZE]>>
}
impl VeryVeryLongTypeName {
    const CHUNK_SIZE: usize = 69;
}
```

I expect this code to either compile fine or provide a warning similar to #76200.

However, I see an error:
```
11 | impl<'i, RS: H> I<'i, RS> {
   |          --- help: consider adding an explicit lifetime bound...: `RS: 'i +`
...
15 |         self.s.chunks.push(Box::new([0; Self::CHUNK_SIZE]));
   |                                         ^^^^ ...so that the type `RS` will meet its required lifetime bounds
```
I don't understand why `RS: 'i` is needed for accessing a constant off of `Self`. As one might expect, replacing `Self::CHUNK_SIZE` with `VeryVeryLongTypeName::CHUNK_SIZE` works around the issue. 

Tested with stable `1.55.0` and `1.57.0-nightly (2021-09-23 2b862bed9889808b6962)`.
Repository: pytorch
Issue: [LTC] Memory growing up during training until OOM
Labels: triaged,lazy,module: lazy

Hi, we are running Resnet50 FP32 training with lazy tensor core. And we find the memory will keep grow up in each iteration until OOM. To reproduce this issue, I have written a simple test case as below:
```
import torch
import torch.nn as nn
import copy
import time
import lazy_tensor_core
import lazy_tensor_core.core.lazy_model as ltm
import lazy_tensor_core.debug.metrics as met

lazy_tensor_core._LAZYC._ltc_init_ts_backend()
class SimpleNet(torch.nn.Module):
    def __init__(self):
        super(SimpleNet, self).__init__()
        self.conv = torch.nn.Conv2d(64, 128, (3, 3), stride=(2, 2), padding=(1, 1), bias=False)
        self.conv2 = torch.nn.Conv2d(128, 128, (3, 3), stride=(1, 1), padding=(1, 1), bias=False)
        self.conv3 = torch.nn.Conv2d(64, 128, (1, 1), stride=(2, 2), padding=(0, 0), bias=False)
    def forward(self, x):
        x1 = self.conv(x)
        y1 = self.conv2(x1)
        y2 = self.conv3(x)
        y = y1 + y2
        y = torch.flatten(y, start_dim=1)
        return y
lazy_device = ltm.lazy_device()
model = SimpleNet()
model.train().to(lazy_device)

for i in range(10000):
    x = torch.rand(64, 64, 3, 3, requires_grad=True).to(lazy_device)
    y = model(x)
    yg = torch.rand(64, 512).to(lazy_device)
    loss = nn.CrossEntropyLoss()
    output = loss(y, yg)
    output.backward()
    print(output)
    ltm.mark_step()
    print(met.metrics_report())
```
From this test case, I also see the memory is growing up when running. Is there any thing I misunderstand when modify the training test case with lazy_tensor? BTW: I am using lazy_tensor_staging branch(7f3d5928d4cfde9b732f9460a952e1de033d699f).
Repository: pytorch
Issue: [JIT] Start Using and Optimizing on Symbolic Shape Inference in Freezing
Labels: oncall: jit

## 🚀 Feature

```
import torchvision, torch
model = torchvision.models.mobilenet_v2()
frozen_model = torch.jit.freeze(torch.jit.script(model.eval()))
print(frozen_model.graph)
```

Will give the following IR

https://gist.github.com/eellison/b51df44f216e964eb860149bf4a80721

Which includes 

>   %input.8 : Tensor(*, 1280, *, *) = aten::conv2d(%input.14, %self.features.18.0.weight_fused_bn, %self.features.0.0.bias_fused_bn, %3948, %3949, %3948, %20)
  %x.5 : Tensor = aten::hardtanh_(%input.8, %6, %5)
  %3220 : int[] = aten::size(%x.5)
  %3221 : int = aten::len(%3220)
  %3222 : bool = aten::gt(%3221, %11)
   = prim::If(%3222)
    block0():
      -> ()
    block1():
       = prim::RaiseException(%4) # <string>:5:2
      -> ()
  %3223 : Tensor = aten::adaptive_avg_pool2d(%x.5, %3948)

We already have [an optimization](https://github.com/pytorch/pytorch/blob/master/torch/csrc/jit/passes/peephole.cpp#L164) that will optimize out `len(size(x))`, so with `hardtanh_` registered with a [shape function](https://github.com/pytorch/pytorch/blob/master/torch/csrc/jit/runtime/symbolic_shape_registry.cpp#L559) or https://github.com/pytorch/pytorch/issues/65642 landed, we should see
` %x.5 : Tensor(*, 1280, *, *)  = aten::hardtanh_(%input.8, %6, %5)` in the graph and be able to optimize out the len and exception check. 

The update here would be to run [Shape Analysis](https://github.com/pytorch/pytorch/blob/master/torch/csrc/jit/passes/symbolic_shape_analysis.h#L11) and then make sure in `runOptimization` we are running tensor type peepholes.
Repository: godot
Issue: Make RenderingDevice inherit RefCounted instead of Object
Labels: enhancement,topic:core,topic:rendering

### Godot version

4.0.dev

### System information

Windows 10, Vulkan

### Issue description

With `RenderingDevice` you can allocate GPU memory. However, because it is an `Object`, this memory will not be automatically freed when the RenderingDevice is no longer in use. This makes leaking memory very easy to do.

It becomes especially problematic in the context of issues #6784 (and related/duplicate #31166), where there is no proper place in GDScript to handle manual destruction in scripts that aren't Nodes, requiring workarounds to avoid leaking GPU memory.

From what I can see, almost all classes that inherit Object are singletons, which RenderingDevice is not.

### Steps to reproduce

N/A

### Minimal reproduction project

N/A
Repository: pytorch
Issue: [LTC] Building unit tests on Debian results in double defined _GLIBCXX_USE_CXX11_ABI flag
Labels: triaged,module: lazy

Building the unit tests on debian with gcc (clang won't build gtest) results in a bunch of exceptions like:

```sh
/usr/include/x86_64-linux-gnu/c++/10/bits/c++config.h:283:27: error: #if with no expression
  283 | #if _GLIBCXX_USE_CXX11_ABI
``` 

This is due to `-D_GLIBCXX_USE_CXX11_ABI` being defined twice. Turning on verbose building I see the following for a `c++` command:

```sh
/usr/bin/c++  -I/home/nickkreeger/src/pytorch/lazy_tensor_core -I/home/nickkreeger/src/pytorch/lazy_tensor_core/torch_ltc/csrc -isystem /home/nickkreeger/src/pytorch/lazy_tensor_core/test/cpp/build/gtest/src/googletest-src/googletest/include -isystem /usr/local/include/python3.9 -isystem /home/nickkreeger/src/pytorch/torch/include -isystem /home/nickkreeger/src/pytorch/torch/include/torch/csrc/api/include -O3 -DNDEBUG -D_GLIBCXX_USE_CXX11_ABI=1 -Wno-sign-compare -Wno-deprecated-declarations -Wno-return-type -D_GLIBCXX_USE_CXX11_ABI= -MD -MT CMakeFiles/test_ptltc.dir/cpp_test_util.cpp.o -MF CMakeFiles/test_ptltc.dir/cpp_test_util.cpp.o.d -o CMakeFiles/test_ptltc.dir/cpp_test_util.cpp.o -c /home/nickkreeger/src/pytorch/lazy_tensor_core/test/cpp/cpp_test_util.cpp     <command-line>: warning: "_GLIBCXX_USE_CXX11_ABI" redefined                                                                                                <command-line>: note: this is the location of the previous definition   
```

Looks like something in the build config is getting carried over into the stock CXX flags. 

cc @malfet @seemethere
Repository: godot
Issue: Editor does not start with "ERROR: start: WASAPI: Start failed"
Labels: bug,platform:windows,needs testing,topic:audio

### Godot version

3.3.3.stable.mono.official.b973f997f

### System information

Windows 10

### Issue description

When I start Godot an error occurs, here is the console output:
`Godot Engine v3.3.3.stable.mono.official.b973f997f - https://godotengine.org
OpenGL ES 2.0 Renderer: AMD Radeon RX 5700 XT
OpenGL ES Batching: ON

ERROR: start: WASAPI: Start failed
   At: drivers/wasapi/audio_driver_wasapi.cpp:775
Mono: Log file is: 'C:\Users\askar\AppData\Roaming/Godot/mono/mono_logs/2021-09-25_07.17.42_16336.log'`

The sound does not work accordingly

### Steps to reproduce

Start Godot Engine v3.3.3.stable.mono.official.b973f997f

### Minimal reproduction project

_No response_
Repository: pytorch
Issue: Does ZeroRedundancyOptimizer support re-split partition on load_state_dict?
Labels: oncall: distributed,triaged

I first run a trainer with `ZeroRedundancyOptimizer` and save its checkpoint (after invoke `optimizer.consolidate_state_dict()`). And if I use different number of gpus when resume from that checkpoint with `load_state_dict()`, it raises error that partition doesn't match.
Is it a bug or an expected behavior?

cc @pietern @mrshenli @pritamdamania87 @zhaojuanmao @satgera @rohan-varma @gqchen @aazzolini @osalpekar @jiayisuse @SciPioneer @H-Huang @gcramer23
Repository: material-ui
Issue: [system] Add API section
Labels: docs,package: system

How to use `useTheme` while not using the deprecated `@mui/styles` package?
Repository: flutter
Issue: [in-app-purchase] API to fetch existing PurchaseDetail
Labels: c: new feature,platform-android,p: in_app_purchase,package,c: proposal,P3,team-android,triaged-android

## Use case
While upgrading/downgrading a subscription on Android, the [documentation](https://github.com/flutter/plugins/tree/master/packages/in_app_purchase/in_app_purchase#upgrading-or-downgrading-an-existing-in-app-subscription) suggests the following:
```
final PurchaseDetails oldPurchaseDetails = ...;
PurchaseParam purchaseParam = GooglePlayPurchaseParam(
    productDetails: productDetails,
    changeSubscriptionParam: ChangeSubscriptionParam(
        oldPurchaseDetails: oldPurchaseDetails,
        prorationMode: ProrationMode.immediateWithTimeProration));
InAppPurchase.instance
    .buyNonConsumable(purchaseParam: purchaseParam);
```

However, there is no API to fetch `oldPurchaseDetails`.

## Proposal

Add `getPurchaseDetails({String transactionID, String productID})`, that returns `PurchaseDetails`, populated with the relevant `PurchaseWrapper`.
Repository: godot
Issue: ProjectSettings.GetSetting returns different type depending on content
Labels: bug,topic:dotnet

### Godot version

3.3.3.stable.mono.official

### System information

Windows 10

### Issue description

ProjectSettings.GetSetting() returns **Godot.Collections.Array if** type is set as StringArray before and **has values** in the project settings, but returns **string[] if** the value **is empty** in the project settings.

### Steps to reproduce

Code to add the array:
```
var propInfo = new Godot.Collections.Dictionary();
propInfo["name"] = "some_array";
propInfo["type"] = Variant.Type.StringArray;
ProjectSettings.SetSetting("test_setting/some_array", new[] {"content"});
ProjectSettings.AddPropertyInfo(propInfo);
ProjectSettings.SetInitialValue("test_setting/some_array", new string[0]);
```

Code to test this:
```
void TestValue()
{
    const string valuepath = "test_setting/some_array";
    if (ProjectSettings.HasSetting())
    {
        var settingsValue = ProjectSettings.GetSetting(valuepath);
        if (settingsValue == null) GD.Print("Value is null");
        else if (settingsValue is Array arr) GD.PushWarning("Value is Array");
        else if (settingsValue is string[] sArr) GD.PushWarning("Value is string[]");
        else GD.PrintErr("Value is something else");
    }
}
```

### Minimal reproduction project

_No response_
Repository: terminal
Issue: Schema does not allow actions without arguments in verbose form
Labels: Help Wanted,Product-Terminal,Issue-Task,Area-Schema

### Windows Terminal version (or Windows build number)

1.9.1942.0

### Other Software

_No response_

### Steps to reproduce

Bind any 'shortcut action' using the following syntax:
```
{
  "command": {
    "action": "toggleAlwaysOnTop" // Most of the toggle actions qualify
  },
  "keys": "ctrl+alt+shift+§" // Any key combination
}
```

### Expected Behavior

The schema should allow this, it's a working syntax.

### Actual Behavior

It's considered invalid, with two problems:

* > Missing property "delta".
  > Arguments corresponding to an Adjust Font Size Action
* > String does not match the pattern of "adjustFontSize".
Repository: flutter
Issue: Add keyboard input support for dates, times and durations to TextFormField/TextField
Labels: a: text input,c: new feature,framework,f: material design,c: proposal,a: desktop,P3,team-text-input,triaged-text-input

Hi,
For desktop and web it is essential that the TextFormField widget natively supports the format to input a **date**, a **timeofday**, a **date and time** and a **duration** by **keyboard**.
On desktop, this type of data is only occasionally entered through an external dialog box. 
Thanks.
Regards,
Jose
Repository: rust
Issue: Improve error messages for borrowing in match arms
Labels: A-diagnostics,T-compiler

<!--
Thank you for filing a bug report! 🐛 Please provide a short summary of the bug,
along with any information you feel relevant to replicating the bug.

If you cannot produce a minimal reproduction case (something that would work in
isolation), please provide the steps or even link to a repository that causes
the problematic output to occur.
-->
When I match a mutable reference of `foo`:
1. Use part of the `foo` only in one match arm (the link is in use longer than the match itself, otherwise everything compiles). 
2. While in the other, there's no direct usage and I want to borrow `foo` again. 

The compiler gives the error "cannot borrow `foo` as mutable more than once at a time".
```rust
match &mut foo.data {
    Some(value) => Some(value),
    None => {
        foo.data = Some(35);
        None
    }
}
```

 It would be great if the compiler could understand that I only need a part of this and would suggest using `ref mut` in match arm:

```rust
match foo.data {
    Some(ref mut value) => Some(value),
    None => {
        foo.data = Some(35);
        None
    }
}
```

[Playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=b5bfe4c287ad39f70225f836caaeff28)


Many thanks to @bugaevc for pushing me to report this and and simplifying the example :)

<!--
If the problem is not self-explanatory, please provide a rationale for the
change.
-->

<!--
If dramatically different output is caused by small changes, consider also
adding them here.

If you're using the stable version of the compiler, you should also check if the
bug also exists in the beta or nightly versions. The output might also be
different depending on the Edition.
-->
Repository: go
Issue: encoding/xml: serialization of `interface{}` attribute is unsupported, even when dynamic type implements relevant interfaces
Labels: NeedsFix

<!--
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
go version go1.17.1 linux/amd64
</pre>

Also reproduces on the playground (see below).

### 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/silex/.cache/go-build"
GOENV="/home/silex/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/silex/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/silex/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/lib64/golang"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/lib64/golang/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.17.1"
GCCGO="gccgo"
AR="ar"
CC="x86_64-solus-linux-gcc"
CXX="x86_64-solus-linux-g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
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-build858878585=/tmp/go-build -gno-record-gcc-switches"
</pre></details>

### What did you do?

<!--
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
-->

When marshalling a struct with an interface field to an XML attribute, an error is returned. [Simple example](https://play.golang.org/p/jGWjyv3hK7Y), [extended example](https://play.golang.org/p/XsnHOwOFZ2P).

### What did you expect to see?

No error, and for the simple example:

```
XML: <Test a="2009-11-10T23:00:00Z"></Test>
```

The extended example should return:

```
<Test a="hello" b="there"><a>hello</a><b>there</b></Test>    (err: %!s(<nil>))
<ITest><a>hello</a><b>there</b></ITest>                      (err: %!s(<nil>))
<ITest a="hello" b="there"><a>hello</a><b>there</b></ITest>  (err: %!s(<nil>))
```

### What did you see instead?

```
Error: xml: unsupported type: time.Time
```

This error is incorrect (`time.Time` implements `encoding.TextMarshaler`), so should be supported.

Additionally, this does work with values instead of attributes, as shown in the extended example:

```
<Test a="hello" b="there"><a>hello</a><b>there</b></Test>    (err: %!s(<nil>))
<ITest><a>hello</a><b>there</b></ITest>                      (err: %!s(<nil>))
                                                             (err: xml: unsupported type: main.A)
```
Repository: godot
Issue: Failed to import csv correctly then freeze.
Labels: bug,topic:import

### Godot version

v3.4.beta5.mono.official [dd0ee4872]

### System information

Debian 11

### Issue description

Since beta5 I have these errors

```
 Error importing CSV translation: 'Damage' is not a valid locale.
 editor/editor_file_system.cpp:1755 - Error importing 'res://data/Skills.csv'.
```
for each csv I have in project ( are not made for translations. 
-If I try to set as `Keep` In `Filesystem` tab I still see the red cross
-If I try to select all, the  `Keep` option is missing in `Import` tab
-if I set all/some  of them as Keep I still have the error in output tab
nb: they are not in `res://translation` folder
nb2.: **If I try to do some of these changes the editor freeze then I have to restart it.**

### Steps to reproduce

See before

### Minimal reproduction project

NA
Repository: electron
Issue: [Feature Request]: Add an option to specify the resource directory
Labels: enhancement :sparkles:

### Preflight Checklist

- [X] I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/master/CONTRIBUTING.md) for this project.
- [X] I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md) that this project adheres to.
- [X] I have searched the [issue tracker](https://www.github.com/electron/electron/issues) for a feature request that matches the one I want to file, without success.

### Problem Description

The value of `process.resourcesPath` depends on the location of the executable file of the electron process:
https://github.com/electron/electron/blob/57d088517ceef0d6c7bd6dde6fd740813c3cf943/shell/common/node_bindings.cc#L307-L311
This makes it impossible to share a single electron binary (e.g. system-wide) with a symbolic link since all the applications will try to use the same resource directory.

### Proposed Solution

Allow explicitly specifying the location of the resources directory (`process.resourcesPath`), for example with a flag such as `--resources-path`, instead of relaying on the location of the electron binary. This would allow multiple electron applications with different resources to use the same electron binary.

### Alternatives Considered

- Patching the source code of the application to replace `process.resourcesPath` with the custom resource directory.

- Create a hard link to the electron binary in the application directory instead of a symbolic link.

### Additional Information

I am not really familiar with Electron so I don't know if the proposed idea would be feasible.

I am currently trying to package an Electron application from source for the [Nix](https://nixos.org/) ecosystem. I tried to use the Electron binaries that are already packaged for Nix (exists at `/nix/store/wrls7fyk1p2x6ab881h00yjldkih72ys-electron-12.1.0/lib/electron/electron`). But the problem is Nix has a read-only store so putting resources in `/nix/store/wrls7fyk1p2x6ab881h00yjldkih72ys-electron-12.1.0/lib/electron/resources` is not an option. Even if it were, the current approach doesn't allow sharing a single electron binary with multiple applications that uses the resource directory as far as I can tell.

Regarding the alternatives mentioned above:
- I tried patching the application source code to add a line such as `process.resourcesPath = process.env["ELECTRON_RESOURCES_PATH"];`, but I couldn't figure out where I should put this line. I tried adding this to the entry point file, but the dev console still showed the old value. I also tried adding this to the preload script but that also didn't work. In the end I added it just before where it is used.
- Using hardlinks is not currently an option because of the way Nix derivations are built[^1](https://github.com/NixOS/nix/issues/1272).
Repository: pytorch
Issue: Transpose channels when exporting to ONNX
Labels: module: onnx,triaged

## 🚀 Feature

It would be great to allow to switch between channels first and channels last possibly via an argument in `torch.onnx.export()`.
 
## Motivation

I was converting a pre-trained PyTorch model to ONNX and later convert it to TensorFlow SavedModel. TensorFlow prefers using channels last format and there does not seem to be an easy way to do so.

## Alternatives

a pseudo workaround to this was to make a wrapper net:

```py
class WrapperNetwork(nn.Module):
    def __init__(self, main_module: nn.Module):
        super(WrapperNetwork, self).__init__()
        self.main_module = main_module
        
    def forward(self, x):
        x = torch.transpose(x, 1, 2)
        return self.main_module(x)
```

and call `torch.onnx.export` on this which does not seem like a good solution to me, what do you think?


cc @BowenBao @neginraoof