sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: flutter
Issue: Support using `dart:ui` `Scene`s where `Image`s are accepted
Labels: c: new feature,engine,a: images,P3,team-engine,triaged-engine

## Use case

There have been many cases recently where developers need to snapshot UI as a bitmap for efficiency reasons, or to achieve effects that are unobtainable with the current SceneBuilder APIs. Previously, developers could use `toImage()` to convert a `Scene` or `Picture` asynchronously. And now developers can use `toGpuImage()` to do the same, but lazily.

With the GC issues seen in #106621, there are more valid usecases for snapshotting a potentially updating Scene while letting the Raster Cache manage the memory (instead of Dart).

A Scene-level solution can also take advantage of damage rect calculations, allowing automatic partial updates which improves memory bandwidth and rendering performance.

## Proposal

This API is a WIP, and is subject to change with feedback.

At the core of the API, we have `SceneImage`. As a subclass of dart:ui `Image` it can go wherever it goes.

```dart
class SceneImage extends Image {
  SceneImage(int width, int height);

  void render(Scene scene); // Mirrors [FlutterView.render] intentionally. May not render the scene immediately.
}
```

However the key difference is that these images weakly reference an Image in the Raster Cache. The only thing `SceneImage` stores is the dimensions, and the last scene passed to `SceneImage.render`. This reduces the size of `SceneImage` reported to Dart's GC.

As long as the `SceneImage` is utilized within a frame, the scene is retained in the Raster Cache. Updates to the scene (through calls to `SceneImage.render`) may use the previously rendered contents to do a partial update.

`SceneImage` is a bridge to the Raster Cache, without exposing it through `dart:ui`.

cc @flar @dnfield @jonahwilliams
Repository: pytorch
Issue: 2-dimensional arange
Labels: triaged,enhancement,module: nestedtensor,module: tensor creation

### 🚀 The feature, motivation and pitch

When dealing with batches of variable-length sequences, we often track the start indices, length of sequences, and end indices.

```python
maximum_sequence_length = 3
number_of_sequences = 3
data = torch.random(maximum_sequence_length * number_of_sequences, feature)
sequence_length = torch.tensor([1, 3, 2])
start_idx = torch.tensor([0, 3, 6])
end_idx = torch.tensor([1, 6, 8])
```

When we want to index our `data` tensor, and select only the non-padded/valid data, we need to generate some indices that go from `start_idx` to `end_idx`. Currently, there is no vectorized way to do this, and so we do the following
```python
# Sad, non-vectorized loop :(
idx = torch.cat([torch.arange(start_idx[b], end_idx[b]) for b in range(batch)])
print(idx)
# Parenthesis added for readability
>>> [(0, ), (3, 4, 5), (6, 7)]
# With the indices, we can now index our data, free from padding
data[idx]
```

This has applications to filtering and message-passing GNNs. Over many batches, this for-loop concatenation overhead tends to add up. It would be nice to have something vectorized like

```python
torch.arange2d(start_idx: torch.Tensor, end_idx: torch.Tensor) -> torch.Tensor:
   """Given a vector of s_i \in starts and e_i \in ends, 
   returns [s_1, s_1 + 1, ... e_1, s_2, s_2 + 1, ... e_2, ... e_n]"""

```

### Alternatives

`repeat_interleave` can be used in some edge cases, but does not work in general. Slicing using a tensor would also solve this, i.e.
```python
data[start_idx: end_idx]
```
but this is not currently supported either.

### Additional context

cc @cpuhrsch @gchanan @mruberry
Repository: pytorch
Issue: `torch.ops.aten.find` inconsistent with `str.find`
Labels: module: cpp,triaged,module: sorting and selection

### 🐛 Describe the bug

For empty target strings `aten::find` will always return the value of the starting position in the string, even when the given range is invalid.

```
>>> import torch
>>> "example".find("", 100, 0)
-1
>>> torch.ops.aten.find("example", "", 100, 0)
100
```

As far as I can tell the cause of the discrepancy is found in `register_prim_ops.cpp` on [line 1522](https://github.com/pytorch/pytorch/blob/b4e491798c0679ab2e61f36a511484d7b8ecf8d3/torch/csrc/jit/runtime/register_prim_ops.cpp#L1522) where if the target string is empty, it will always search for the target even if the search range is invalid in some way.


Additionally, this can lead to crashes for certain inputs as shown below.
```
>>> import torch
>>> torch.ops.aten.find("example", "a", 100, 200)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/quinn/torch-mlir/mlir_venv/lib/python3.10/site-packages/torch/_ops.py", line 148, in __call__
    return self._op(*args, **kwargs or {})
IndexError: basic_string::substr: __pos (which is 100) > this->size() (which is 7)

```

### Versions

Collecting environment information...
PyTorch version: 1.13.0.dev20220623+cpu
Is debug build: False
CUDA used to build PyTorch: Could not collect
ROCM used to build PyTorch: N/A

OS: Arch Linux (x86_64)
GCC version: (GCC) 12.1.0
Clang version: 13.0.1
CMake version: version 3.22.5
Libc version: glibc-2.35

Python version: 3.10.5 (main, Jun  6 2022, 18:49:26) [GCC 12.1.0] (64-bit runtime)
Python platform: Linux-5.18.5-arch1-1-x86_64-with-glibc2.35
Is CUDA available: False
CUDA runtime version: Could not collect
GPU models and configuration: GPU 0: NVIDIA GeForce RTX 2070 SUPER
Nvidia driver version: 515.48.07
cuDNN version: Could not collect
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

Versions of relevant libraries:
[pip3] numpy==1.23.0
[pip3] torch==1.13.0.dev20220623+cpu
[pip3] torch-mlir==20220620.509
[pip3] torchvision==0.14.0.dev20220623+cpu
[conda] Could not collect


cc @jbschlosser
Repository: pytorch
Issue: Semi-reproducible random torch.baddbmm NaNs
Labels: needs reproduction,triaged,module: NaNs and Infs

### 🐛 Describe the bug

The following code snippet appears to cause `torch.baddbmm` to randomly generate NaNs when run *on CPU*

```
for i in range(10000):
    out = torch.baddbmm(
        torch.zeros([1, 1, 1], dtype=torch.float32),
        torch.FloatTensor([[[1]]]),
        torch.FloatTensor([[[1]]]),
        beta=0,
    )
    assert not torch.isnan(out).any(), i
# AssertionError: 9886
# (or some other number)
```

Despite running the same calculation each time, it often fails not on the first try, but many tries in.

(Sometimes I need to run the loop several times before it actually encounters a NaN, which seems odd to me.)

I've tried this on two different hardware setups and encountered the same issue.

Hope I'm not just doing something silly!

### Versions

Collecting environment information...
PyTorch version: 1.11.0
Is debug build: False
CUDA used to build PyTorch: 10.2
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: Could not collect
CMake version: version 3.10.2
Libc version: glibc-2.27

Python version: 3.9.11 (main, Mar 29 2022, 19:08:29)  [GCC 7.5.0] (64-bit runtime)
Python platform: Linux-4.18.0-305.28.1.el8_4.x86_64-x86_64-with-glibc2.27
Is CUDA available: True
CUDA runtime version: 10.1.243
GPU models and configuration: GPU 0: Quadro RTX 8000
Nvidia driver version: 470.57.02
cuDNN version: /usr/lib/x86_64-linux-gnu/libcudnn.so.7.6.5
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

Versions of relevant libraries:
[pip3] mypy-extensions==0.4.3
[pip3] numpy==1.21.2
[pip3] torch==1.11.0
[pip3] torchaudio==0.11.0
[pip3] torchvision==0.12.0
[conda] blas                      1.0                         mkl
[conda] cudatoolkit               10.2.89              hfd86e86_1
[conda] ffmpeg                    4.3                  hf484d3e_0    pytorch
[conda] mkl                       2021.4.0           h06a4308_640
[conda] mkl-service               2.4.0            py39h7f8727e_0
[conda] mkl_fft                   1.3.1            py39hd3c417c_0
[conda] mkl_random                1.2.2            py39h51133e4_0
[conda] numpy                     1.21.2           py39h20f2e39_0
[conda] numpy-base                1.21.2           py39h79a1101_0
[conda] pytorch                   1.11.0          py3.9_cuda10.2_cudnn7.6.5_0    pytorch
[conda] pytorch-mutex             1.0                        cuda    pytorch
[conda] torchaudio                0.11.0               py39_cu102    pytorch
[conda] torchvision               0.12.0               py39_cu102    pytorch
Repository: axios
Issue: The instance request in createInstance should use the reuqest method on the context
Labels: state::triage

#### Is your feature request related to a problem? Please describe.

If I need to modify the prototype of all requests of an instance, then I should do this

```js
import axios from 'axios'
const original = axios.request.bind(axios)
axios.request = function(configOrUrl, config) {
  // ....
}
```

The context method used in instance is effective

```js
axios.get // yes
axios.post // yes
```

But calling instance directly does not work

```js
axios() // no
```

#### Describe the solution you'd like

The reason is that in createInstance instance function and context.request are not equal

This is the workaround I envisioned

- `lib/axios.js`

```js
function createInstance(defaultConfig) {
  const context = new Axios(defaultConfig);
  // -             bind(Axios.prototype.request, context);
  const instance = bind(context.request, context);
  // ...
  return instance;
}
```
However, this will cause nested references
```js
axios.request.request.request.request.request // fun
```
so it should be
```js
function createInstance(defaultConfig) {
  const context = new Axios(defaultConfig);
  function request(...args) { context.request(...args) }
  // -             bind(Axios.prototype.request, context);
  const instance = bind(request, context);
  // ...
  return instance;
}
```
Repository: flutter
Issue: [Keyboard] Support stateful shortcut activators
Labels: a: text input,c: new feature,framework,c: proposal,P3,team-framework,triaged-framework

Currently all shortcut activators are stateless (despite having a "session"). The following features might require stateful activators to implement:
- Long pressing a key.
- Tap a shift with no key events between its down and up.
- Ctrl-A, Ctrl-D.
Repository: tauri
Issue: [feat] Snap layouts support on Windows when using frameless windows
Labels: type: feature request,status: upstream,platform: Windows

### Describe the problem

[Details about snap layouts](https://docs.microsoft.com/en-us/windows/apps/desktop/modernize/apply-snap-layout-menu)

If I use the window decorations provided by Tauri, then I can use snap layouts.

![snap layouts](https://user-images.githubusercontent.com/33774862/176607202-b11f4a1f-dcfc-49ea-a1be-788a4bfd8705.png)

If I set the window to `"decorations": false`, the window will not be able to use snap layouts.

![no snap layouts](https://user-images.githubusercontent.com/33774862/176606655-34d18560-7c4e-40c4-b70b-9fa628b60ccf.png)


### Describe the solution you'd like

Tauri already uses data-tauri-drag-region to support window dragging, so we might consider introducing a attribute like data-tauri-maximize-button-region to support this feature.

This should work as follows.

```
<div data-tauri-drag-region class="titlebar">
  --- omitted ---
  <div data-tauri-maximize-button-region class="titlebar-button" id="titlebar-maximize">
    <img
      src="https://api.iconify.design/mdi:window-maximize.svg"
      alt="maximize"
    />
  </div>
  --- omitted ---
</div>
```

### Alternatives considered

Platform-specific window behavior is very complex, and leaving window behavior to the user can be tricky to implement.

Electron provides [BrowserWindow ](https://www.electronjs.org/docs/latest/api/browser-window) to handle similar issues.

Tauri can provide similar built-in components, which will also be easy to manage and optimize.

### Additional context

_No response_
Repository: pytorch
Issue: RuntimeError: DataLoader worker (pid 22822) is killed by signal: Aborted. 
Labels: module: dataloader,triaged

### 🐛 Describe the bug

I set num_workers=4 in dataloader,the training process can run normally, and an error is reported in the verification phase。

### Versions

torch                     1.11.0
torchvision               0.12.0

cc @SsnL @VitalyFedyunin @ejguan @NivekT
Repository: pytorch
Issue: Overlapping Optimizer.step() with DDP backward
Labels: oncall: distributed,module: optimizer

### 🚀 The feature, motivation and pitch

DDP `all_reduce` parameters' gradients in `buckets`, which means that some parameters would get their finial gradients earlier than others. This exposes an opportunity for `Optimizer` to optimize part of parameters before `backward` finished. So that overlapping part of `Optimizer.step` and DDP `backward` is possible and may led to higher parallelism or even hide some `all_reduce` cost.

### Alternatives

This re-scheduling may be achieved by compilation optimizations like `LazyTensorCore` and `XLA`.

### Additional context

<img width="1160" alt="截屏2022-06-30 下午3 58 35" src="https://user-images.githubusercontent.com/73142299/176624701-e2ec53da-5240-42e9-8ca2-7c5e71f6b62a.png">

As the timeline above, if we can start `Optimizer.step` working on those parameters already has finial gradients, we may save almost all `Optimizer.step`'s cost.

cc @pietern @mrshenli @pritamdamania87 @zhaojuanmao @satgera @rohan-varma @gqchen @aazzolini @osalpekar @jiayisuse @SciPioneer @H-Huang @kwen2501 @vincentqb @jbschlosser @albanD
Repository: ant-design
Issue: Upload.Dragger can't trigger beforeUpload when accept is not empty
Labels: Inactive

### Reproduction link

[![Edit on CodeSandbox](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/antd-reproduction-template-forked-3y8jzl?file=/index.js)

### Steps to reproduce
0. I hava a accept attribute of Upload.Dragger component, now I need upload a file **which extension doesn't  match accept**
1. click to upload, beforeUpload triggered
2. drag to upload, beforeUpload not triggered

### What is expected?

drag to upload, beforeUpload also triggered

### What is actually happening?

drag to upload, beforeUpload not triggered

| Environment | Info |
| --- | --- |
| antd | 4.21.4 |
| React | 18.2.0 |
| System | win10 |
| Browser | edge 102 |

---
I want to do some checking work on beforeUpload hook. but when drag file into box, beforeUpload not triggered.

<!-- generated by ant-design-issue-helper. DO NOT REMOVE -->
Repository: flutter
Issue: [video_player]Change the aspectRatio of video in realtime
Labels: c: new feature,p: video_player,package,c: proposal,team-ecosystem,P3,triaged-ecosystem

Use videoPalyer to play hls live broadcast. The video stream may change aspectRatio in real time, but the video player cannot adapt to the ratio. Is there any way to get the real-time ratio of the video?
Repository: flutter
Issue: [Proposal]Change padding in PopupMenuItem from EdgeInsets to EdgeInsetsGeometry.
Labels: framework,f: material design,c: proposal,team-design,triaged-design

Hello 

Change padding in PopupMenuItem from EdgeInsets to EdgeInsetsGeometry to accept EdgeInsetsDirectional.

Thanks
Repository: tensorflow
Issue: Cyclic Python dependency due to tensorflow-io-gcs-filesystem
Labels: type:build/install,TF 2.9

 ### Issue Type

Build/Install

### Source

source

### Tensorflow Version

2.7 - 2.9 (master)

### Custom Code

No

### OS Platform and Distribution

Any

### Python version

Any

### Current Behaviour?

https://github.com/tensorflow/tensorflow/commit/c2da23e4d8460ebeeda9cf987dc2f11282f80d6e introduced a dependency on `tensorflow-io-gcs-filesystem`.
However that in turn depends on `tensorflow`.

Hence it is impossible to install TensorFlow from source as it requires `tensorflow-io-gcs-filesystem` and that cannot be installed either as it requires TensorFlow.

I would strongly suggest to remove `tensorflow-io-gcs-filesystem` from the `REQUIRED_PACKAGES`

Note that TensorFlow is used on other platforms, e.g. PPC where prebuild wheels are not possible. Also using those platform specific wheels may clash with different compilation options/stdlibs/libraries/...

CC @yongtang
Repository: deno
Issue: Unsound unsafe usages
Labels: feat

[clippy::mut_from_ref](https://rust-lang.github.io/rust-clippy/master/#mut_from_ref)

https://github.com/denoland/deno/blob/4e92f38d2ced6cbc2c7ed13d79d739dd4ddadb4c/core/ops_metrics.rs#L56-L62

It is not safe to create `&mut [u8]` which is pointing to uninitialized memory. 
See also <https://github.com/rust-lang/unsafe-code-guidelines/issues/71>

https://github.com/denoland/deno/blob/4e92f38d2ced6cbc2c7ed13d79d739dd4ddadb4c/ext/net/ops_tls.rs#L378-L382

https://github.com/denoland/deno/blob/4e92f38d2ced6cbc2c7ed13d79d739dd4ddadb4c/serde_v8/de.rs#L679-L692

https://github.com/denoland/deno/blob/4e92f38d2ced6cbc2c7ed13d79d739dd4ddadb4c/serde_v8/de.rs#L708-L720

[clippy::uninit_vec](https://rust-lang.github.io/rust-clippy/master/#uninit_vec)

https://github.com/denoland/deno/blob/4e92f38d2ced6cbc2c7ed13d79d739dd4ddadb4c/serde_v8/magic/bytestring.rs#L52-L66

https://github.com/denoland/deno/blob/4e92f38d2ced6cbc2c7ed13d79d739dd4ddadb4c/serde_v8/magic/u16string.rs#L35-L49

https://github.com/denoland/deno/blob/4e92f38d2ced6cbc2c7ed13d79d739dd4ddadb4c/snapshots/lib.rs#L30-L53

What is this?

https://github.com/denoland/deno/blob/4e92f38d2ced6cbc2c7ed13d79d739dd4ddadb4c/serde_v8/magic/value.rs#L30-L48

Related (maybe): 
+ https://github.com/denoland/deno/issues/12341
+ https://github.com/denoland/deno/issues/12653
+ https://github.com/denoland/deno_core/issues/129
Repository: flutter
Issue: Material TabBars should scroll horizontally with the mouse wheel by default
Labels: c: new feature,framework,f: material design,f: scrolling,a: mouse,P3,team-design,triaged-design

## Use case

I have a `TabBar` with many tabs in my desktop application. At the moment, the only way to properly scroll across the tab list is to hold shift while moving the scroll wheel (if #75180 isn't an issue).

## Proposal

`TabBar`s should scroll horizontally by default in response to the mouse wheel, as it makes no sense to scroll them vertically since they cannot move on that axis.
Repository: rust
Issue: incorrect resolutions for type dependent paths in struct expression
Labels: C-cleanup,C-enhancement,A-associated-items,T-compiler

```rust
trait Foo: Sized {
    type Output;

    fn func() -> Self;
}

struct Type<T> { value: T }

impl<T: Default> Foo for Type<T> {
    type Output = Self;

    fn func() -> Self {
        Self::Output { value: Default::default() }
    }
}
```
stores the following resolution for `Self::Output` via `fn write_resolution`:

```rust
Ok((AssocTy, DefId(0:4 ~ test1[f74d]::Foo::Output)))
```

the `node_substs` for `Self::Output` are however empty. This makes the stored resolution completely useless as there isn't really a way to go from `Foo::Output` to `Type<T>::Output` which is what we actually need.

We should probably store `<Foo as Type<T>>::Output` instead. This happens here https://github.com/rust-lang/rust/blob/7425fb293f510a6f138e82a963a3bc599a5b9e1c/compiler/rustc_typeck/src/check/fn_ctxt/checks.rs#L1592-L1605
Repository: pytorch
Issue: pad_sequence and pack_sequence should support length zero tensors
Labels: module: rnn,triaged,enhancement

### 🚀 The feature, motivation and pitch

This situation naturally occurs when training on irregularly sampled times series data with a fixed real-time sliding window, i.e. the model received all observations made within a time interval of say 2 hours.

Since the time series is irregular, it can happen that there are no observations in this time-slice, hence the resulting tensor has a 0-length dimension.

## MWE

```python
import torch
from torch.nn.utils.rnn import pack_sequence, pad_sequence

tensors = [torch.randn(abs(n - 3)) for n in range(6)]
pad_sequence(tensors, batch_first=True, padding_value=float("nan"))
pack_sequence(tensors, enforce_sorted=False)
```


### Alternatives

_No response_

### Additional context

_No response_

cc @zou3519
Repository: vscode
Issue: Codicons should be excluded from the quick pick's filtering
Labels: bug,confirmed,terminal-tabs

![Recording 2022-06-30 at 07 53 59](https://user-images.githubusercontent.com/2193314/176709054-bc7d1948-a646-4225-b7e6-cdf051842ac1.gif)
Repository: vscode
Issue: Allow (modifier)+click for "step in target"
Labels: feature-request,debug

Both @hediet and @bpasero mentioned that having a modifier+click action to step into a target would be helpful, I agree.
Repository: storybook
Issue: Access `args` when overriding `docs.source.code`
Labels: feature request,needs triage

**Is your feature request related to a problem? Please describe**
I'd like access to the component `args` while creating a custom code preview with `parameters.docs.source.code`. Currently I can only provide a hard coded string to override the code block. I'd like to be able to provide a function that can take in a components `args` and return the code string that reflects the args.

It would also be nice if this function was passed the default code string so that it could modify it if it would like, say to remove certain parts of the code that aren't relevant.

```
docs: {
    source: {
      code: (args) => `button({type: ${args.primary}, size: ${args.size})`,
    },
  },
```

```
docs: {
    source: {
      code: (args, originalSource) => originalSource.replace(regEx, ''),
    },
  },
```

**Describe the solution you'd like**
Either allow `parameters.docs.source.code` to be both a string or a function that takes in args and returns a string, or add a `parameters.docs.source.codeFn` property that can be used for this.

**Describe alternatives you've considered**
Horrible hacks to some how create the code string that I want inside the story function that has access to `args` and have that function have a side effect that mutates the `parameters.docs.source.code` and somehow trigger the story to render again with the right code block. I'm not even sure this would work, it's too gross for me to even want to try.

**Are you able to assist to bring the feature to reality?**
yes, I can...

**Additional context**
For reasons I won't get in to, our design system has "components" that are really just template functions that return html strings. For example. `button({type: 'primary'})`. When I write a story for one of these template function components the code block will display the html output of the function, which is not what I want to document. To prevent devs from copying the output html into their code, I want to override the code block to show the how to use the template function component. If there is a better way to document this kind of component please let me know! Most of our components are web-components, so our storybook is set up for that, but we also have a bunch of these template components. Thanks!