sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: pytorch
Issue: Inference Tensors should not be allowed to hold `grad_fn`
Labels: triaged,inference mode

### 🐛 Describe the bug

Here's a sneaky script to only override the backward implementation for a PyTorch op. This should not be used but posting to share what seems like a bug in Inference Tensor implementation (as per the title and comments in the code below).
```py
import torch

op = torch.ops.aten.sin.default

class MyFunc(torch.autograd.Function):
    @staticmethod
    def forward(ctx, input):
        ctx.save_for_backward(input)
        with torch.inference_mode():
            out = op(input)
        # returns an inference tensor with `grad_fn`. 
        # out.detach() also returns an inference tensor with a `grad_fn`
        return out
        # returns a non inference tensor with a `grad_fn` set
        return out.clone()

    @staticmethod
    def backward(ctx, grad_output):
        input, = ctx.saved_tensors
        return grad_output + input

mylib = torch.library.Library("aten", "IMPL")

mylib.impl("sin", MyFunc.apply, "AutogradCPU")

a = torch.zeros(10, requires_grad=True)
out = torch.sin(a)
print(out, out.sum(), torch.is_inference_mode_enabled(), torch.is_grad_enabled())
# errors out when we return an inference tensor since out.sum() magically returns a tensor with no `grad_fn`.
out.sum().backward()
print(out, a.grad)
```

### Versions

master
Repository: pytorch
Issue: forward-mode support for "logically composite" operators
Labels: triaged,module: derivatives,module: forward ad

Today, in PyTorch, when we add forward-mode AD support for an operator, there are times when the forward-mode AD formula recomputes intermediate values used in the operator implementation. There is currently no way to share intermediate values between the operator implementation and forward-mode AD formula, especially if an operator implementation is some fused kernel.

Recomputation is sometimes not a problem; @Chillee's work on recomputation in AOTAutograd shows that when paired with a fuser, recomputation can be faster than sharing intermediate values due to avoiding relatively expensive memory transfers. However, PyTorch's many forward-mode AD formulas are not fused kernels (yet, at least :)).

This issue is an ask to investigate if we should reconsider how we are writing forward-mode AD formulas to avoid recomputation.

## Pitch

Let's consider a hypothetical operator. Assume that there is some fused CPU and CUDA kernel for it.
```
def mulmul_reference(a, b, c):
  mul1 = a * b
  mul2 = mul1 * c
  return mul2

def mulmul(a, b, c):
  return some_fast_kernel(a, b, c)
```
To add a forward-mode AD formula for it, today we would write it like the following:
```
def mulmul_jvp(a, a_t, b, b_t, c, c_t):
  mul1 = a * b
  mul1_t = a_t * b + a * b_t
  mul2_t = mul1 * c_t + mul1_t * c
  return mul2_t
```
Note that at some point, `mulmul` and `mulmul_jvp` both compute mul1.

### Proposal

Instead of writing `mulmul_jvp` we would implement `mulmul` like the following:
```
def mulmul(a, b, c):
  if any_is_dual_tensor(a, b, c):
    return mulmul_reference(a, b, c)
  return some_fast_kernel(a, b, c)
```
This gives us forward-mode AD support for mulmul AND it has the nice property that `mul1` does not get computed twice.

CC'ing folks who have been working on forward-mode AD-related things
cc @soulitzer @albanD @Lezcano @samdow
Repository: flutter
Issue: Filtering `updateAcquireFence: Did not find frame.` out from flutter run output
Labels: platform-android,tool,good first issue,has reproducible steps,P2,found in release: 3.0,found in release: 3.1,team-android,triaged-android

# repro

https://github.com/cedvdb/flutter_repros/tree/google_map_init

- clone
- replace { YOUR_API_KEY } in AndroidManifest with your google api key 
- run & go to third tab

 I'm using a Redmi Note 9

# the issue

My console is flooded with messages when displaying a google map.

The type of message I think are of 2 different types, but I guess they might be related, I'm not sure though though but both happen when showing the map.

first this one is being printed a bunch of time:

```
E/FrameEvents(25124): updateAcquireFence: Did not find frame.
D/Surface (25124): lockHardwareCanvas
```

Then there is an error:

```
W/SnapshotHandler(25124): Unable to retrieve flag snapshot for com.google.android.libraries.consentverifier#com.example.flutter_repros, using defaults.
W/SnapshotHandler(25124): java.io.FileNotFoundException: /data/user/0/com.example.flutter_repros/files/phenotype/shared/com.google.android.libraries.consentverifier#com.example.flutter_repros.pb: open failed: ENOENT (No such file or directory)
W/SnapshotHandler(25124): 	at libcore.io.IoBridge.open(IoBridge.java:492)
```


# version

Flutter 3.0.1 • channel stable • https://github.com/flutter/flutter.git
Framework • revision fb57da5f94 (17 hours ago) • 2022-05-19 15:50:29 -0700
Engine • revision caaafc5604
Tools • Dart 2.17.1 • DevTools 2.12.2
Repository: angular
Issue: Forms: Create helper types to extract values from controls and/or vice versa
Labels: feature,state: Needs Design,area: forms,forms: Controls API,feature: under consideration,forms: strictly typed

Consider a typed group for storing contact information:

```
declare interface ContactControls {
	name: FormControl<string|null>;
}

contactForm: FormGroup<ContactControls> = ...;

saveForm(form: FormGroup<ContactControls>) {
	service.newContact(contactForm.value);
}
```

What should be the type of `newContact`? The answer, of course, is the value type:

```
declare interface Contact {
	name: string|null;
}

class ContactService {
	newContact(c: Contact) {}
}
```

This is quite redundant, and therefore, we should allow the value type to be generated automatically. (Or possibly the other way around, which is more generally useful, but a bit trickier to implement.) We already have the helper types to do this, but we need to do some additional design work in order to expose them publicly.
Repository: excalidraw
Issue: Support exporting in specific aspect ratios
Labels: enhancement,discussion

During image export, allow to export in a specific aspect ratio which would pad from X/Y as necessary so that the image fits. This is useful when exporting for a specific purpose, such as for Twitter.

![image](https://user-images.githubusercontent.com/5153846/169572837-e225835b-b583-440c-9fe3-28cf581fca59.png)

examples:

![image](https://user-images.githubusercontent.com/5153846/169572718-54058327-baee-4ddf-9d6e-d5b724b6fc2b.png)

original idea from https://dev.to/with_heart/how-to-scale-excalidraw-diagrams-for-twitter-posts-2nba
Repository: flutter
Issue: `AboutDialog` button labels still appear in all caps in Flutter 3.0.0
Labels: framework,f: material design,a: internationalization,has reproducible steps,P2,found in release: 3.0,found in release: 3.1,team-design,triaged-design

Related: https://github.com/flutter/flutter/issues/61820

---

With `useMaterial3` flag turned on, `AboutDialog` shown by `showAboutDialog` adopts the MD3 look but button labels are still using the MD2 ALL CAPS convention.

![Screenshot 2022-05-20 232817](https://user-images.githubusercontent.com/1127628/169566054-e34a8305-1fcc-4009-9cf4-bd8e182f0d05.png)

## Steps to Reproduce

<!-- Please include full steps to reproduce so that we can reproduce the problem. -->

1. Run code sample
2. Tap 'Show About dialog' button.

**Expected results:** <!-- what did you want to see? -->

Button labels are in sentence case as per MD3 guideline.
[https://m3.material.io/components/buttons/overview](https://m3.material.io/components/buttons/overview)

**Actual results:** <!-- what did you see? -->

Button labels are in ALL CAPS.

<details>
<summary>Code sample</summary>

```dart
import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData(useMaterial3: true),
      home: const Scaffold(
        body: Center(
          child: MyWidget(),
        ),
      ),
    );
  }
}

class MyWidget extends StatelessWidget {
  const MyWidget({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return ElevatedButton(
      onPressed: () {
        showAboutDialog(
          context: context,
          applicationName: 'My App',
          applicationVersion: '1.0.0',
        );
      },
      child: const Text('Show About dialog'),
    );
  }
}
```

</details>

(Code sample created from DartPad - Flutter 3.0.0 / Dart 2.17.0)
Repository: PowerToys
Issue: ⭐ Feature Request: Ability to set custom paths (like ~) for the folder plugin under powertoys run
Labels: Idea-Enhancement,Product-PowerToys Run,Needs-Triage,Run-Plugin

### Description of the new feature / enhancement

If there could be something like this to take input of 'shortcut' to that path
![image](https://user-images.githubusercontent.com/71930656/169577860-59715411-6467-4163-b230-30f463825b01.png)

EG: if i were to add d~ with the path C:\Users\username\Desktop
should give me ability to use d~/Code instead of ~/Desktop/Code

so in the input of powertoys run if we add d~ it takes us to desktop

### Scenario when this would be used?

would be really easy to navigate to nested folders & folders that are difficult to reach from Home (~)

### Supporting information

_No response_
Repository: pytorch
Issue: Override sym_sizes to create LTC IR for SymIntNode
Labels: triaged,lazy
Repository: rustdesk
Issue: Show other users cursors on host pc
Labels: Fund

Would be a nice feature to see other users cursors like in AnyDesk maybe in different colors and the username written below.

<!-- POLAR PLEDGE BADGE START -->
## Upvote & Fund

- We're using [Polar.sh](https://polar.sh/rustdesk) so you can upvote and help fund this issue.
- We receive the funding once the issue is completed & confirmed by you.
- Thank you in advance for helping prioritize & fund our backlog.

<a href="https://polar.sh/rustdesk/rustdesk/issues/573">
<picture>
  <source media="(prefers-color-scheme: dark)" srcset="https://polar.sh/api/github/rustdesk/rustdesk/issues/573/pledge.svg?darkmode=1">
  <img alt="Fund with Polar" src="https://polar.sh/api/github/rustdesk/rustdesk/issues/573/pledge.svg">
</picture>
</a>
<!-- POLAR PLEDGE BADGE END -->
Repository: bitcoin
Issue: Witness-Only Option for fundrawtransaction
Labels: Feature

In lightning we have to fund channels with only inputs that are non-malleable, thus for safety generally just want to fund with witness-based outputs. It's be nice if there were an option to fundrawtransaction to explicitly request that.
Repository: flutter
Issue: Add a smoke test for macOS desktop that verifies it can render
Labels: a: tests,engine,platform-mac,a: desktop,P2,team-macos,triaged-macos

e.g. fill the window with some flat color and make sure the color shows up.

If the test runs in debug unopt mode, it would have caught the regression from #104154
Repository: rust
Issue: Tracking Issue for seekable io::Take
Labels: T-libs-api,C-tracking-issue,A-io

Feature gate: `#![feature(seek_io_take)]`

(feature gate open to change)

This is a tracking issue for adding seek instance for `io::Take`, see issue [#37214](https://github.com/rust-lang/rust/issues/37214).

### Why
Imagine there's a smaller components within a larger file, the component have predefined ranges, reading beyond the range should be a hard error. But some fields are variable size encoded, so it's hard to know how many bytes to read until we already decoded/read a large part of it. It is super cumbersome to check every read is within the limit (of the component); however, with `io::Take`, this is much easier: We only need to create a new `io::Take` by limiting the upper bound to the component's spec. and just let the user to read what ever needed -- any attempt to read beyond the limit would cause a hard io error.

This is all good, but sometimes we need more powerful io rather than read. For instance, we may need `peek` and restore `stream_position()` depends on what data was `peek`-ed, skip a large chunk of unwanted bytes, or maybe we simply wanted to keep track of the `stream_position()` for better error handling. This is not possible because `io::Take` is *not* `Seek`.

### Public API

Added `Seek` instance for `io::Take<T>`, so that we can call `io::Seek` APIs on `io::Take<T>`.

```rust

pub struct Take<T> {
    inner: T,
    limit: u64,
    cursor: u64,          // <---- new member, current position within `Take`.
}

impl<T: Seek> Seek for Take<T> {
    fn seek(&mut self, pos: SeekFrom) -> Result<u64> {
        // snip
    }
}
```

This is possible by adding a `cursor` member to `io::Take`, together with `limit`, we have:

  - cursor + limit === original_limit (when Take is constructed)
  - Seek beyond original_limit => stays at original_limit
  - Seek beyond 0 (< 0) => `ErrorKind::InvalidInput` (EINVAL).
  - Read beyond original_limit => io error.
  - seek without position changes is honored (This is expected, see `BufReader` [doc](https://doc.rust-lang.org/std/io/struct.BufReader.html#impl-Seek)).

The proposed method has an advantage over approach in #37214, by *not* using an extra `stream_position()` when `io::Take` is constructed.
Repository: godot
Issue: DisplayServer.screen_get_dpi() is wrong on linux with DQHD display (5120x1440)
Labels: bug,platform:linuxbsd,topic:porting

### Godot version

4.0-alpha8, 3.4.4-stable, 3.3.4-stable

### System information

Linux 5.17.5-76051705-generic,  Pop!_OS 22.04 Renderer: NVIDIA GeForce GTX 1070 with Max-Q Design/PCIe/SSE2 510.68.02

### Issue description

When you open the editor/game it incorrectly detects a highdpi display and doubles the display scale (auto-detected display scale is 200% but should be 100%)
You can still manually set the display scale to 100% in the Editor Settings -> Display Scale.

When you call `DisplayServer.screen_get_dpi()` the DPI is listed as 83312 rather than anything close to the actual DPI of my display of 109.. https://www.samsung.com/us/computing/monitors/gaming/49--odyssey-g9-gaming-monitor-lc49g95tssnxza/


### Steps to reproduce

Run the included reproduction on a 5120x1440 DQHD display with 109 dpi.

### Minimal reproduction project

[godot4-dpi-screen-scale-repro.zip](https://github.com/godotengine/godot/files/8744560/godot4-dpi-screen-scale-repro.zip)
Repository: pytorch
Issue: Three memory copies of every dataloader cpu tensor
Labels: module: multiprocessing,module: dataloader,module: cuda,triaged,enhancement

### 🐛 Describe the bug

(from slack discussion with @albanD)

Is it possible to both share_memory and pin_memory for a tensor, for dataloading across shared memory with zero copies?
```
>>> x.share_memory_().pin_memory().is_shared()
False
>>> x.pin_memory().share_memory_().is_pinned()
False
```

It seems like the answer is no, since cudaHostAlloc doesn't seem to be compatible with shared memory, which is a shame because there's implicitly three full copies of every tensor generated by a dataset:
- dataset generates an example
- dataloader collates it
- dataloader copies it into shared memory to share with main process
- memory pinning thread copies into pinned memory before transfer to device

How might we reduce these extra copies? The H100 generation is going to start being impossible to feed.

(sort of related to https://pytorch.slack.com/archives/C3PDTEV8E/p1652536474661579 and https://pytorch.slack.com/archives/C3PDTEV8E/p1652844740547679)

### Versions

Not relevant, but I'm on PyTorch 1.11.0 and on CUDA 11.4, with 8x V100s or A100s.

cc @VitalyFedyunin @SsnL @ejguan @NivekT @ngimel
Repository: flutter
Issue: Add-to-app sample is missing FlutterFragment requirements
Labels: platform-android,d: examples,a: existing-apps,P3,team-android,triaged-android

https://api.flutter.dev/javadoc/io/flutter/embedding/android/FlutterFragment.html

Using a FlutterFragment requires forwarding a number of calls from an Activity to ensure that the internal Flutter app behaves as expected:

#onPostResume()
#onBackPressed()
#onRequestPermissionsResult(int, String[], int[])
#onNewIntent(Intent)
#onUserLeaveHint()

The following add-to-app example is missing these requirements:
https://github.com/flutter/samples/blob/master/add_to_app/multiple_flutters/multiple_flutters_android/app/src/main/java/dev/flutter/multipleflutters/DoubleFlutterActivity.kt#L15

cc @gaaclarke
Repository: deno
Issue: Provide debug logging with the deno CLI
Labels: cli,suggestion

[additional context](https://twitter.com/biwanczuk/status/1527636222377590785)

When debugging Deno programs it would be helpful to have greater visibility into what is happening under the covers. 
For our use-case the programs we run are typically invoked by code in [this repo](https://github.com/slackapi/deno-slack-runtime).
It would be helpful to have log output for the different stages of the execution along with timestamps similar to Terraform's [debugging](https://www.terraform.io/internals/debugging) capability.  

For example

```console
$ deno_log=DEBUG deno run <some program>
2022/05/20 15:04:16 [INFO] Deno version: 1.22.0
2022/05/20 15:04:16 [INFO] v8 version: 10.0.139.6
2022/05/20 15:04:16 [DEBUG] executing main module 
2022/05/20 15:04:16 [DEBUG] worker loading event
2022/05/20 15:04:16 [DEBUG] running worker event loop
2022/05/20 15:04:18 [DEBUG] event loop existed
```
Repository: PowerToys
Issue: PowerToys Run should provide a mechanism to disable plugins if they're missing dependencies
Labels: Idea-Enhancement,Help Wanted,Product-PowerToys Run,Run-Plugin

### Description of the new feature / enhancement

The VS Code plugin can be toggled on even if you don't have VS Code installed. IMO, it should be disabled and grayed out in the settings page, with a message indicating why.

This could be accomplished by a new interface in Wox.Plugin which plugins could implement to report back a status saying whether they can be enabled or not, and if not a string saying why.

### Scenario when this would be used?

For the VS Code plugin, and other plugins that depend on the presence of various dependencies. For example, a OneNote plugin would require OneNote installed, the Everything plugin depends on Everything, a Graph plugin would require an MSA logged in, etc.

### Supporting information

_No response_
Repository: terminal
Issue: Execution on hold until tab is selected/focused
Labels: Issue-Bug,Area-UserInterface,Product-Terminal,Priority-1

### Windows Terminal version

1.12.10983.0

### Windows build number

10.0.22621.1

### Other Software

_No response_

### Steps to reproduce

I'm opening 12 tabs in the same WT window, like this:
```
for %%G in (boost wtl openssl asio taocpp-json ctre scnlib nanosvg wil detours lexilla) do (
	wt --maximized -w 1 new-tab --title "%%G" -d "%%G" "%~dp0%%G\update.cmd"
)
```


### Expected Behavior

All tabs/commands should run in parallel, without needing to select the tab first.

### Actual Behavior

Under some circumstances (it doesn't happen always, no reliable way to reproduce), the commands only start until the tab is being selected/focused.

This behavior does not happen when wt.exe is called once with all the new-tab commands separated by ;
Repository: react
Issue: Bug: Support ESM for the use-sync-external-store shim
Labels: Status: Unconfirmed

<!--
  Please provide a clear and concise description of what the bug is. Include
  screenshots if needed. Please test using the latest version of the relevant
  React packages to make sure your issue has not already been fixed.
-->

React version:
use-sync-external-store 1.0.0, 1.1.0

## Steps To Reproduce

1. open up chrome dev tools
```js
>>> var x = await import("https://cdn.skypack.dev/use-sync-external-store")
>>> x.useSyncExternalStore
undefined
```

<!--
  Your bug will get fixed much faster if we can run your code and it doesn't
  have dependencies other than React. Issues without reproduction steps or
  code examples may be immediately closed as not actionable.
-->

Link to code example:
See above code snippet
I was trying to hack around with valtio
and if I do

```js
import valtio from "https://cdn.skypack.dev/valtio@1.6.0";
```
or in the console

```js
>>> var v = await import("https://cdn.skypack.dev/valtio@1.6.0")
Uncaught SyntaxError: The requested module '/-/use-sync-external-store@v1.0.0-ZzO0qn27iKOvDc2m57IV/dist=es2019,mode=imports/unoptimized/shim/index.js' does not provide an export named 'useSyncExternalStore' 
```

## The current behavior

the use-sync-external-store shim does not support esm


## The expected behavior

please support esm


## additional context

the bug was reported at valtio

https://github.com/pmndrs/valtio/issues/452
An attempt was made to workaround the issue at their end
But the import 
`>>> var v = await import("https://cdn.skypack.dev/valtio@1.6.1")`
Still fails on the use-sync-external-store shim.
Repository: godot
Issue: No print to Output panel in infinite loop
Labels: discussion,topic:core,topic:editor

### Godot version

3.4.2.stable.official

### System information

Windows 10

### Issue description

When using a print statement in an infinite loop, nothing will be printed to the Output panel.
If the loop breaks, all will be printed to the output panel at once.
See issue [#22184](https://github.com/godotengine/godot/issues/22184) that was supposedly fixed in 3.1.2, it's the same issue I'm encountering.

### Steps to reproduce

Run this script:
func _ready():
    var i = 0
    while true:
        i += 1
        print(i)



### Minimal reproduction project

_No response_