sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: pytorch
Issue: PyTorch Embedding Op with max_norm is not working as expected
Labels: module: cuda,triaged,module: norms and normalization,module: embedding,bug

### 🐛 Describe the bug

The behavior of renorm inside the `max_norm` will renorm the weight to the norm same as `max_norm` when it is specified.

However, under GPU and if the input is multi-dimensional (like dim = 3). Its behavior is not expected and also weight will be renormed to the wrong norm (like less than `max_norm`)

To repo this here is code snippet:
```
import torch

input_size = [36, 15, 48] 
embedding_size = 28
embedding_dim = 5

embedding = torch.nn.Embedding(embedding_size, embedding_dim, max_norm=2.0, norm_type=2.0).cuda()
weight_norm = torch.linalg.norm(embedding.weight, dim=-1).clone()
original_weight_norm = weight_norm.clone()
print("weight_norm", original_weight_norm)
weight_norm[weight_norm > 2.0] = 2.0
print("expected weight_norm", weight_norm)

for i in range(4):
    input = torch.randint(0, embedding_size, tuple(input_size)).cuda()
    torch.nn.functional.embedding(input, embedding.weight, max_norm=2.0, norm_type=2.0)
actual_weight_norm = torch.linalg.norm(embedding.weight, dim=-1)
print("actual weight ", actual_weight_norm)
delta = actual_weight_norm - weight_norm
threshold = 0.01
print(torch.allclose(weight_norm, actual_weight_norm), "norm more than threshold ", threshold, delta[torch.abs(delta) > threshold])
```

One example output is like:
```
weight_norm tensor([2.0776, 2.0551, 2.6955, 1.9832, 1.6644, 1.8127, 2.5646, 2.5205, 1.6097,
        3.0849, 1.6583, 1.6348, 2.7448, 1.6877, 1.7610, 1.9241, 0.8003, 0.7706,
        2.2592, 2.0385, 2.6742, 1.5317, 2.1481, 0.9371, 1.6462, 1.7186, 1.2157,
        2.8872], device='cuda:0', grad_fn=<CloneBackward0>)
expected weight_norm tensor([2.0000, 2.0000, 2.0000, 1.9832, 1.6644, 1.8127, 2.0000, 2.0000, 1.6097,
        2.0000, 1.6583, 1.6348, 2.0000, 1.6877, 1.7610, 1.9241, 0.8003, 0.7706,
        2.0000, 2.0000, 2.0000, 1.5317, 2.0000, 0.9371, 1.6462, 1.7186, 1.2157,
        2.0000], device='cuda:0', grad_fn=<IndexPutBackward0>)
actual weight  tensor([2.0000, 2.0000, 2.0000, 1.9832, 1.6644, 1.8127, 2.0000, 1.5870, 1.6097,
        1.2966, 1.6583, 1.6348, 2.0000, 1.6877, 1.7610, 1.9241, 0.8003, 0.7706,
        1.7705, 2.0000, 1.8975, 1.5317, 2.0000, 0.9371, 1.6462, 1.7186, 1.2157,
        1.8775], device='cuda:0', grad_fn=<LinalgVectorNormBackward0>)
False norm more than threshold  0.01 tensor([-0.4130, -0.7034, -0.2295, -0.1025, -0.1225], device='cuda:0',
       grad_fn=<IndexBackward0>)
```

Sometimes, you need to run it more than once to repo but it is usually within 2-3 runs.

### Versions

Run on the latest night build and Linux and cuda 11.0

cc @ngimel
Repository: flutter
Issue: Reconsider which `flutter test --help` options should be hidden by default
Labels: a: tests,tool,a: quality,P3,team-tool,triaged-tool

Currently `flutter test --help` has some options that are hidden by default and others that aren't. Our choices seem a bit confusing though.

Specifically, `--platform` is hidden, but is the way to select to run the tests on the web. On the other hand, `--dds-port` and `--web-renderer` aren't hidden, even though they're useless without `--platform`. Relatedly, `-d` is shown, but seems to have no effect.

`--track-widget-creation` is a bit esoteric and should probably be hidden.

`--flavor` probably should too, does that even do anything for tests? Actually several of these parameters seem like they likely aren't useful for `flutter test`, such as `--device-user`. We could also probably hide `--dart-define` by default.
Repository: pytorch
Issue: Inconsistent naming convention for end of enum in DispatchKey
Labels: triaged,module: dispatch

### 🐛 Describe the bug

Here is a clear contradiction:

```
  EndOfBackendKeys = PrivateUse3Bit,
```

but

```
  EndOfFunctionalityKeys, // End of functionality keys.
```

This means for iterating through backend keys you should <= the ending, but for functionality keys you should < the ending. It is inconsistent.

----

Let's take a step back. There are a few problems with our naming conventions here.

1. It's not clear if end is inclusive or exclusive
2. It's not clear if start is inclusive or exclusive
3. It's not clear if length includes the zero-valued invalid key

We should establish clear definitions for each of these (possibly renaming if the existing names are ambiguous) and then apply this uniformly.

My preference is that:
1. End is exclusive
2. Start is inclusive
3. Length includes zero-valued key

cc @bdhirsh 

### Versions

master
Repository: godot
Issue: Opening resource of type "TextFile" causes error or freeze
Labels: bug,topic:editor,needs testing

### Godot version

3.4.4

### System information

Windows 10, intel CPU

### Issue description

When you save a text resource file and then reopen the editor and try to open it up again in the editor I get the following error message:

 scene/resources/resource_format_text.cpp:804 - res://new_textfile.tres:1 - Parse Error: Expected '['
 Failed to load resource 'res://new_textfile.tres'.
 Failed loading resource: res://new_textfile.tres. Make sure resources have been imported by opening the project in the editor at least once.
 scene/resources/resource_format_text.cpp:1143 - res://new_textfile.tres:1 - Parse Error: Expected '['

### Steps to reproduce

1. Open new project in godot
2. Click create new resource of type "Text File" in file editor
3. Edit Resource in script editor
4. Save Resource
5. Reload Godot
6. Try to open beforenamed file
7. Observe error messge

### Minimal reproduction project

N/A
Repository: flutter
Issue: Unexpected contour count after adding arc to path
Labels: framework,engine,P2,team-engine,triaged-engine

The contour count returned by calling `computeMetrics().length` on a path with one expected arc seems to be inconsistent. The arguments for `startAngle` and `sweepAngle`  of  `addArc()` and `arcTo()` apparently has direct impact on the reported number of contours in the path.

I have run the example below in the DartPad based on both Flutter 3.0.5 Dart SDK 2.17.6 as well as Flutter 2.10.5 Dart SDK 2.16.2 with consistent output. The same behavior was also noticed when building to a device.

```
import 'dart:ui';
import 'dart:math';

void main() {
  double circleSweep = 2 * pi;

  Path path1 = Path()
    ..addArc(
        Rect.fromCircle(center: Offset.zero, radius: 2.5), 0.5, -circleSweep);

  Path path2 = Path()
    ..addArc(
        Rect.fromCircle(center: Offset.zero, radius: 2.5), pi, -circleSweep);

  Path path3 = Path()
    ..arcTo(Rect.fromCircle(center: Offset.zero, radius: 2.5), 0.5,
        -circleSweep, true);

  print(path1.computeMetrics().length); // Expected: 1, Actual: 0
  print(path2.computeMetrics().length); // Expected: 1, Actual: 1
  print(path3.computeMetrics().length); // Expected: 1, Actual: 0
}
```
Repository: pytorch
Issue: DISABLED test_non_contiguous_tensors_nn_ConvTranspose1d_cuda_complex32 (__main__.TestModuleCUDA)
Labels: module: nn,triaged,module: flaky-tests,module: complex,skipped

Platforms: linux

This test was disabled because it is failing in CI. See [recent examples](https://hud.pytorch.org/flakytest?name=test_non_contiguous_tensors_nn_ConvTranspose1d_cuda_complex32&suite=TestModuleCUDA&file=test_modules.py) and the most recent trunk [workflow logs](https://github.com/pytorch/pytorch/runs/7415127953).

Over the past 3 hours, it has been determined flaky in 2 workflow(s) with 3 red and 2 green.

cc @albanD @mruberry @jbschlosser @walterddr @kshitij12345 @saketh-are @ezyang @anjali411 @dylanbespalko @Lezcano @nikitaved
Repository: godot
Issue: Problem with Materials in Android
Labels: bug,platform:android,topic:rendering,needs testing,topic:3d

### Godot version

3.4.4

### System information

Smasung Not10+ Gles2

### Issue description

There is no problem when I test it on the computer, there is no problem on my teammate's phone, but I tested it on 2 Samsung phones and the materials on them are like disco balls.All of the animated objects I added have this problem, they were all downloaded from different sites
![SmartSelect_20220715-014844_Hunting Simuilator](https://user-images.githubusercontent.com/64804972/179855954-d034d443-5cdb-4331-9833-14951d4f90c3.jpg)

https://user-images.githubusercontent.com/64804972/179856760-4c8adf91-0532-4b8d-b1d8-733e972ab129.mp4




### Steps to reproduce

All of the animated objects I added have this problem, they were all downloaded from different sites.

### Minimal reproduction project

_No response_
Repository: flutter
Issue: Autosubmit should add Co-authored-by to commit message.
Labels: team-infra,P2,triaged-infra

When merging a PR that has had more than one contributor, the Github UI adds every other author as `Co-authored-by` of that PR.

(Note that this is only extracting information from who pushed directly to the PR branch, AFAIK it doesn't backtrack into merge commits and stuff like that)

Here's relevant documentation: [Creating a commit with multiple authors](https://docs.github.com/en/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/creating-a-commit-with-multiple-authors).

And here's an example of a multiple-author commit (merged manually):

* https://github.com/flutter/plugins/commit/e8b38f6e03d1fea2746669c6e654714eca582b6e

The autosubmit bot should add Co-Author information. It gives recognition to all the people involved in the commit (and it looks cool from the "history" view too!)
Repository: pytorch
Issue: BatchNorm for complex tensor
Labels: triaged,module: complex,module: primTorch

### 🚀 The feature, motivation and pitch

I am working on a network that takes into consider phase information in speech processing, and would like batchnorm for complex tensor to be possible.

Similar to #47052, #46642

### Additional context

Are there any special points to consider when adding/implementing this feature because of the complex type?

cc @ezyang @anjali411 @dylanbespalko @mruberry @Lezcano @nikitaved @ngimel @albanD
Repository: pytorch
Issue: Modernize logging tensor in torch.testing._internal
Labels: module: internals,module: logging,triaged

### 🐛 Describe the bug

I wrote a better version of logging tensor mode at https://github.com/albanD/subclass_zoo/blob/main/logging_mode.py
let's upstream it to PyTorch

Improvements include proper handling of lists of tensors, dtype and size info in the logs, and cleaner code structure. In particular, I want to get rid of LoggingTensor as a construct and have this be mode only.

### Versions

master

cc @ezyang @bhosmer @smessmer @ljk53 @bdhirsh
Repository: flutter
Issue: [goRouter] After package update, logging does not work.
Labels: c: regression,package,P2,p: go_router,team-go_router,triaged-go_router


After package update, logging does not work.
go_router: 4.1.1
logging: 1.0.2


```
class MyApp extends ConsumerWidget {
  MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context, WidgetRef ref) {


    log.info('MyApp- Start[0]');
    final GoRouter router = ref.watch(routerProvider);
    log.info('MyApp- Start[1]'); //<<<<---------------------------not work


    return MaterialApp.router(
      debugShowCheckedModeBanner: false,
      scrollBehavior: AppScrollBehavior(),
      localizationsDelegates: [
        S.delegate,   
        GlobalMaterialLocalizations.delegate, //Internationalization
        GlobalWidgetsLocalizations.delegate, //Internationalization
        GlobalCupertinoLocalizations.delegate, //Internationalization
      ],
      supportedLocales: S.delegate.supportedLocales,
      theme: AppTheme.light.copyWith(
          textTheme: GoogleFonts.notoSansNKoTextTheme(Theme.of(context).textTheme),
      ),
      themeMode: ThemeMode.system,
      routeInformationProvider: router.routeInformationProvider,
      routeInformationParser: router.routeInformationParser,
      routerDelegate: router.routerDelegate,
    );
  }
}
```
Repository: flutter
Issue: Make it easier (or document how) to create custom cloud builds of the flutter engine
Labels: engine,d: api docs,c: proposal,P3,team-engine,triaged-engine

Flutter has good documentation on how to create custom engine builds. However, this documentation is geared towards those wanting to do development on the engine, not those looking to create custom builds to be used in production apps.

Issue #40220 (modular engine builds) is still open and may never be satisfactorily resolved. In the meantime, it would be very helpful to have robust documentation/tools for those wanting to create and use a custom build in their production apps.

## Motivation

First of all, creating custom builds locally is... a giant pain. To build for every flavor/architecture/target combination requires many many GBs of space and takes a lot of time for those non-Googlers of us who don't have GOMA. For those working on a team, asking every member to go through this process is prohibitive.

Second, local engine builds cannot be easily used to build for production. In particular, building an app bundle for Android cannot (as far as I can tell) be done with a local, custom engine build.

## Use cases

This would be useful for anyone wanting to alter the internals of the flutter engine to support some feature in their app. In my use case, I need to alter the harfbuzz build process to include some functionality that is turned off by default. Low-level alterations to text rendering seem to be a fairly common theme, actually (see #43513). As is exposing more of the internals of Skia through the dart ffi.

## Proposal

The flutter command line tool seems to already be set up to support this (see [comment on #43513](https://github.com/flutter/flutter/issues/43513#issuecomment-716802447)) with an environment variable that can alter the location flutter pulls and caches the various builds from. But, as that comment notes, the "expected format" is not documented.

The [go-flutter](https://github.com/go-flutter-desktop/go-flutter) project sets up a [repo with github actions](https://github.com/go-flutter-desktop/engine-builds) which produces their custom builds for desktop, but it's reverse engineered (note the comment `# hope this works!` on the last line of the ci github actions script). I propose making this an officially supported path rather than leaving it to each developer to implement on their own.

The gap in the current documentation as I understand it is:

1. the full total of build combinations expected by the flutter tool,
2. what artifacts to include from each `engine/src/out/[build]` in the zip, and
3. the structure of the the web hosting of those zipped up artifacts.

The dream would be something like an officially supported github actions yaml file for creating the various builds. But at least documenting the format and/or making public Google's own internal build script would make this possible for everyone.
Repository: rust
Issue: Spurious "implementation of `FnOnce` is not general enough" error
Labels: A-diagnostics,P-medium,T-compiler,A-async-await,AsyncAwait-Triaged,S-bug-has-test,T-types

Hello rustaceans, I'll start with the brief overview and provide repro instructions at the end:

Given the following code:

```rust
    pub async fn spawn_execute_process(self: Arc<Self>) -> JoinHandle<()> {
        tokio::task::spawn(async move {
            execution_process(&self).await;
        })
    }
```

The current output is:

```
error: implementation of `FnOnce` is not general enough
   --> crates/sui-core/src/authority_active.rs:327:9
    |
327 |         tokio::task::spawn(async move {
    |         ^^^^^^^^^^^^^^^^^^ implementation of `FnOnce` is not general enough
    |
    = note: closure with signature `fn(&'0 (u64, sui_types::base_types::TransactionDigest)) -> u64` must implement `FnOnce<(&(u64, sui_types::base_types::TransactionDigest),)>`, for any lifetime `'0`...
    = note: ...but it actually implements `FnOnce<(&(u64, sui_types::base_types::TransactionDigest),)>`
```

This is pretty fishy looking already - as you can see there is no closure in the code above, and the async block doesn't look anything like `(u64, TransactionDigest) -> u64` 

I did however add such a closure _in another file_. And sure enough if I remove that closure from that other file, this problem goes away.

Unfortunately I don't have time to try to pare this down to a minimal repro right now, but I can provide a repo link.

Instructions:
* `git clone https://github.com/mystenmark/sui.git`
* `cd sui`
* `git checkout rust-bug-repro` (commit description is "Reproduce the error at this commit")
* `cargo check`
* Observe the error
* `git checkout rust-bug-repro-workaround` (commit description is "Make the error magically go away")
* `cargo check`
* Observe that the error is gone

As you can see the commit that fixes the error isn't even in the same file, nor does it alter any public function signatures or type defintions: https://github.com/mystenmark/sui/commit/73302e1f5a7942635114e7a5c1f7e1db38b377ee

Lastly, this is happens on both rust 1.62.0 and 1.62.1 - the branch above uses 1.62.1
Repository: TypeScript
Issue: union of function types should be narrowed by their return type
Labels: Suggestion,In Discussion

# Bug Report

### 🔎 Search Terms
narrow function types by return type 
<!--
  What search terms did you use when trying to find an existing bug report?
  List them here so people in the future can find this one more easily.
-->

### 🕗 Version & Regression Information
4.8.0-dev.20220719
### ⏯ Playground Link

<!--
  A link to a TypeScript Playground "Share" link which shows this behavior

  The TypeScript Workbench can be used for more complex setups, try
  https://www.typescriptlang.org/dev/bug-workbench/

  As a last resort, you can link to a repo, but these will be slower for us to investigate.
-->
[Playground link with relevant code](https://www.typescriptlang.org/play?ts=4.8.0-dev.20220719#code/CYUwxgNghgTiAEEQBd4DMCMAueAKXAlPALwB88AdgK4C2ARiDEQD56EnkDOyMAlhQHMCAKFCRYCJKjQAmHOzJ5q9RvFbc+gkcN5o8yAJ4AHEAHs9mBcWLwA5Bv4DbRAN7D4H+GFMVu6U6Y4DoIk6BjsAPQRnAAWplQQwPAMlLAwpgDuIEnIpvDBAslUqLycFLbIwgC+wjp6uIYm5ugyVjb2PI7O8G6eXj5+aAFBnSE2spER3jBwYMgQBpSmqBRpmdnVtZihsvBR07OojOkwQA)

### 💻 Code

<!-- Please post the relevant code sample here as well-->
```ts
declare let f1: (() => number) | (() => string)
declare let f2: () => (number | string)

if (typeof f1() === 'string') {
    const foo: string = f1() //should be narrowed to string but isn't
}

if (typeof f2() === 'string') {
    const foo: string = f2() //correctly not narrowed
}

f1 = f2 //correct error
```

### 🙁 Actual behavior
`f1` is not narrowed to `() => string`

typescript does seem to recognize that the two types `() => (number | string)` and `(() => number) | (() => string)`
 are different though, as it does not allow assigning `f2` to `f1`

### 🙂 Expected behavior
`f1` is narrowed to `() => string`, as the union type `(() => number) | (() => string)` means that the function either only ever returns a `string` or only ever returns a `number`. so if the first function call returns a `string` it's safe to say that subsequent calls will also return a `string`
Repository: flutter
Issue: [go_router] Use of `UrlPathStrategy.path` cause `404 Not Found` HTTP status on browser refresh action because the current location is requested from server but it is not really exist
Labels: package,has reproducible steps,P2,p: go_router,found in release: 3.0,found in release: 3.1,team-go_router,triaged-go_router

I have a web project which is located not in the root of web server but in _subdirectory_. So the initial URL is looks like:
```
http://1.1.1.1/issue/
```
which in its turn automatically redirects to 
```html
http://1.1.1.1/issue/home
```
The `index.html` contains:
```html
<base href="$FLUTTER_BASE_HREF">
```
and the release version is built using
```
flutter build web --base-hre=/issue/
```

If after initial loading of web app I refresh the browser (for example, press the F5 button) then I see the _404 Not Found_ error. It looks like `GoRouter` does not take into account the directory where the app using it is located.

<details>
  <summary>The minimal test app</summary>

```dart
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';

void main() {
  runApp(const MyApp());
}

final goRouter = GoRouter(
  urlPathStrategy: UrlPathStrategy.path,
  routes: [
    GoRoute(
      path: '/',
      redirect: (state) => '/home',
    ),
    GoRoute(
      path: '/home',
      builder: (context, state) {
        return const MyHomePage(title: 'GoRouter Bug');
      },
    ),
  ],
);

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp.router(
      title: 'GoRouter Bug',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      routerDelegate: goRouter.routerDelegate,
      routeInformationParser: goRouter.routeInformationParser,
      routeInformationProvider: goRouter.routeInformationProvider,
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key? key, required this.title}) : super(key: key);

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: const Center(
        child: Text('Press F5 and see the 404 Not Found Page'),
      ),
    );
  }
}
```

</details>

UPDATE: After some investigation we came to conclusion that the problem is in use url strategy. If default `hash` URL strategy is used then all works fine. The issue is reveled when `path` URL strategy is used. When browser is refreshed it tries to execute GET HTTP request for the URL which is currently in browser location (e.g. GET /path) but `path` is not a real path which exits on web server but something like rewritten web server rule.