sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: opencv
Issue: OpenCV C++ don't load model .pb/onnx
Labels: feature,category: dnn

System information (version)
- OpenCV => 4.5.5
- Operating System / Platform => Windows 10 64 Bit
- Compiler => Visual Studio 2019

Hello. I trained a custom model in tensorflow 2.8 save_model.pb. And I am not able to import it into a written program
 Error:
`[libprotobuf ERROR C:\OpenCV\opencv-4.5.5\3rdparty\protobuf\src\google\protobuf\wire_format_lite.cc:581] String field 'o
pencv_tensorflow.FunctionDef.Node.ret' contains invalid UTF-8 data when parsing a protocol buffer. Use the 'bytes' type
if you intend to send raw bytes.
OpenCV: terminate handler is called! The last OpenCV error is:
OpenCV(4.5.5) Error: Unspecified error (FAILED: ReadProtoFromBinaryFile(param_file, param). Failed to parse GraphDef fil
e: ../saved_model.pb) in cv::dnn::ReadTFNetParamsFromBinaryFileOrDie, file C:\OpenCV\opencv-4.5.5\modules\dnn\src\tensor
flow\tf_io.cpp, line 42`

After an unsuccessful attempt to load the tensorflow model, I found that it will convert it to onnx format. There is also a failure

Error:
`OpenCV: terminate handler is called! The last OpenCV error is:
OpenCV(4.5.5) Error: Unsupported format or combination of formats (Unsupported data type: BOOL) in cv::dnn::dnn4_v202112
20::getMatFromTensor, file C:\OpenCV\opencv-4.5.5\modules\dnn\src\onnx\onnx_graph_simplifier.cpp, line 842`

Both models load correctly in the program Netron. Is there a way to use this model in any of the formats in OpenCV for C++? 

Thank you in advance for your answer
Repository: pytorch
Issue: Sampling Issue With Distributions
Labels: triaged,module: half

### 🐛 Describe the bug

There's some inconsistencies when sampling from distributions using different floating point precision levels. Here's some example code that reproduces the effect. I'll sample `100000000` times, but any large number will work. 

```
from torch.distributions import Normal
torch.sum(Normal(torch.tensor(0).half(), torch.tensor(1).half()).sample([100000000]) == 0.) 
torch.sum(Normal(torch.tensor(0).float(), torch.tensor(1).float()).sample([100000000]) == 0.)
torch.sum(Normal(torch.tensor(0).double(), torch.tensor(1).double()).sample([100000000]) == 0.)
```
The thing to note here is that every time you run the `double` version you always get the result `tensor(0)`. Running `float` you get some 0's but inconsistent numbers like `tensor(4)`, `tensor(8)` or `tensor(12)`. When running `half` you get results like `tensor(73176)`. In fact, I haven't seen a number below 73k. 

A potential, but non-optimal, solution I have found is to sample with a float64 type tensor and then return the desired dtype. As an example `torch.sum(torch.randn(100000000, dtype=torch.float64).half() == 0.)` gives numbers very close to 0 (I haven't seen above `tensor(4)` and `float` gives consistent 0's). So it appears that sampling at high precision than casting produced consistent behavior but sampling directly at the desired precision doesn't. 

### Versions

I can confirm this on multiple torch versions. I've tested on 1.8.0 and 1.11.0
Repository: go
Issue: proposal: all: add GOOS=cosmo port for Cosmopolitan Libc
Labels: Proposal,Proposal-Hold

Go is slowly becoming the de-facto lingua franca of DevOps - to the point of replacing shell scripting (see [Cloudflare Blog/Using Go as a scripting language in Linux](https://blog.cloudflare.com/using-go-as-a-scripting-language-in-linux/)). The next great iteration would be a compile once run anywhere type of such scripting (as possible as it can be with external packaging involved). There's already a PoC libc and executable format that can run anywhere (see [Cosmopolitan libc](https://justine.lol/cosmopolitan/) and [APE](https://justine.lol/ape.html)). The author of Cosmpolitan and APE has indicated a [willingness to collaborate and support Go running on Cosmopolitan and producing APE binaries](https://github.com/jart/cosmopolitan/issues/140).
Repository: pytorch
Issue: Some easy way to add xfails to OpInfos
Labels: feature,triaged,module: testing

### 🚀 The feature, motivation and pitch

You write a new OpInfo-based test. The test output shows 100 failed tests. How long does it take you to add the expected failures to common_method_invocations?

Answer: half an hour to an hour.

## Pitch

There are a couple of ways we could make this experience nicer. The first is add some sort of "ADD_XFAILS" flag that, when turned on, automagically adds xfails to torch/testing/_internal/common_methods_invocations.py.

Another way to go about this is to format all of the OpInfos and require there to be e.g. an empty list for `skips`. Then the process of adding a xfail is as simple as copy-paste. (Right now I have to do formatting in addition to adding a new line for the xfail)

### Alternatives

@ezyang's Operator HUD!

### Additional context

n/a

cc @mruberry @ezyang
Repository: TypeScript
Issue: typescript: no more folding range for block comment when typing below
Labels: Bug

*TS Template added by @mjbvz*

**TypeScript Version**: 4.7.0-dev.20220323

**Search Terms**
- getOutliningSpans
- fold / folding
 
---

<!-- ⚠️⚠️ Do Not Delete This! feature_request_template ⚠️⚠️ -->
<!-- Please read our Rules of Conduct: https://opensource.microsoft.com/codeofconduct/ -->
<!-- Please search existing issues to avoid creating duplicates. -->

<!-- Describe the feature you'd like. -->
HTML multi-line comments, write code later, multi-line comments will be automatically expanded, how to set related settings in the settings
Repository: storybook
Issue: Accessibility Upgrades
Labels: feature request,needs triage

**Is your feature request related to a problem? Please describe**
A clear and concise description of the problem. E.g. I'm always frustrated when [...]

I ran Accessibility Insights and Lighthouse on our storybook page to ensure it would be accessible to any viewer. I came upon color contrast issues (storybook link blue and storybook sidebar header gray) and absent names on the playground property select component. 

**Describe the solution you'd like**
What would you like to see added to Storybook to solve problem?

Increase color contrast of story link blue (#1ea7fd) to #1378b8 or darker
Increase color contract of sidebar header gray (#999999) to #6e6e6e  or darker
Add a title, label, or ariaLabel attribute to the select component on the prop playground (WCAG 1.3.1, WCAG 4.1.2)


**Describe alternatives you've considered**
Any alternative solutions or features you've considered.

**Are you able to assist to bring the feature to reality?**
no | yes, I can...

I can submit a PR with the color changes

**Additional context**
Add any other context or screenshots about the feature request here.

<img width="177" alt="Screen Shot 2022-03-23 at 3 28 31 PM" src="https://user-images.githubusercontent.com/39716292/159806743-e86c3607-fc87-4fda-b087-8217fca3e04a.png">
<img width="233" alt="Screen Shot 2022-03-23 at 3 28 40 PM" src="https://user-images.githubusercontent.com/39716292/159806745-b69a27e7-6870-4510-a572-ddcc3d2a97d4.png">
<img width="167" alt="Screen Shot 2022-03-23 at 3 28 51 PM" src="https://user-images.githubusercontent.com/39716292/159806747-3cd49579-4d79-4652-9b28-3194c572b429.png">
Repository: go
Issue: proposal: image/jpeg: support color channels other than 8 bits, eg Gray16
Labels: Proposal

Go version: All recent, including 1.18.
OS: Linux / AMD64

In (e.g) image/jpeg/writer.go:620 , the encoder switches on the underlying image type (`case *image.Gray:`).

However, it has no check for color.Grey16, leading to that format being encoded incorrectly (the least significant 8 bits are discarded silently).

While many viewers elect not to implement it, the jpeg format supports wider color channels than 8 bit. 

Specifying the number of color components and their size in the encoder options would allow the implementation to be used for e.g. medical imaging & scientific instrument data.

I propose that when the size or number of components is set to 0, the existing detection code is used instead (no change when not using the new options), unless you are encoding an image in the `Grey16` color space.
Repository: neovim
Issue: Message area cleared when using highlight MsgArea
Labels: bug,highlight

### Neovim version (nvim -v)

NVIM v0.6.1

### Vim (not Nvim) behaves the same?

No; 8.2.3489

### Operating system/version

macOS 12.3

### Terminal name/version

wezterm

### $TERM environment variable

xterm-256color

### Installation

homebrew

### How to reproduce the issue

Using `nvim --clean -u minimal.lua` where `minimal.lua` contains:

```
vim.cmd 'highlight MsgArea guifg=#aeafb0 guibg=NONE gui=NONE guisp=NONE'
print("TEST TEST TEST")
```
The `highlight` command causes the message area to be cleared such that the `print` flashes by in a millisecond. When there are 2 `print` statement this is not a problem as the pager is invoked before nvim draws the initial screen.

vim (not nvim) invokes the pager on a single print so this is not a problem on vim.

Note: I first noticed this issue using the NightFox theme and have an open problem there (https://github.com/EdenEast/nightfox.nvim/issues/98). I narrowed it down to the single highligh command show above.

### Expected behavior

Expected that a single print statement would be readable, either by be left in the MsgArea or by invoking the pager on startup. This is only a problem on startup.

### Actual behavior

I've got nothing new to say here!
Repository: go
Issue: net: inconsistent behaviour with IPv4-mapped IPv6 CIDRs
Labels: NeedsInvestigation

<!--
Please answer these questions before submitting your issue. Thanks!
-->

### What version of Go are you using (`go version`)?

<pre>
$ go version
go version go1.18 windows/amd64
</pre>

Same behaviour on playground.

### Does this issue reproduce with the latest release?

Yes.

### What did you do?

https://go.dev/play/p/tohTC3rXoZt

```golang
	cidrString := "::ffff:4.4.4.4/64"
	fmt.Println(cidrString)
	_, cidr, _ := net.ParseCIDR(cidrString)
	fmt.Println(cidr)              // == ::/64, seems like it could be the problem
	ip := net.ParseIP("::ffff:4.4.4.4")
	fmt.Println(ip)
	fmt.Println(cidr.Contains(ip)) // == false, seems wrong

	ip = net.ParseIP("4.4.4.4")
	fmt.Println(ip)
	fmt.Println(cidr.Contains(ip)) // == false, seems maybe wrong

	fmt.Println("---")

	cidrString = "::ffff:4.4.4.4/124"
	fmt.Println(cidrString)
	_, cidr, _ = net.ParseCIDR(cidrString)
	fmt.Println(cidr)
	ip = net.ParseIP("::ffff:4.4.4.4")
	fmt.Println(ip)
	fmt.Println(cidr.Contains(ip)) // == true, seems right

	ip = net.ParseIP("4.4.4.4")
	fmt.Println(ip)
	fmt.Println(cidr.Contains(ip)) // == true, seems right
```

### What did you expect to see?

That `::ffff:4.4.4.4/64` would contain `::ffff:4.4.4.4` and `4.4.4.4` (or at least one of them, like `netip.Prefix`).

### What did you see instead?

It doesn't.

My guess is that the problem is that `::ffff:4.4.4.4/64` is turning into the IPv6 CIDR `::/64`, but `::ffff:4.4.4.4` is turning into the IPv4 `4.4.4.4`. And the v4 IP will never be contained in the v6 CIDR. In contrast, `::ffff:4.4.4.4/124` turns into a v4 CIDR and contains the IPs.
Repository: TypeScript
Issue: A Web Worker's type should be made generic
Labels: Suggestion,Awaiting More Feedback

# Suggestion

<!--
  Please fill in each section completely. Thank you!
-->

## 🔍 Search Terms

<!--
  💡 Did you know? TypeScript has over 2,000 open suggestions!
  🔎 Please search thoroughly before logging new feature requests as most common ideas already have a proposal in progress.
  The "Common Feature Requests" section of the FAQ lists many popular requests: https://github.com/Microsoft/TypeScript/wiki/FAQ#common-feature-requests

  Replace the text below:
-->

List of keywords you searched for before creating this issue. Write them down here so that others can find this suggestion more easily and help provide feedback.

- webworker
- generic

## ✅ Viability Checklist

<!--
   Suggestions that don't meet all these criteria are very, very unlikely to be accepted.
   We always recommend reviewing the TypeScript design goals before investing time writing
   a proposal for ideas outside the scope of the project.
-->
My suggestion meets these guidelines:

* [x] This wouldn't be a breaking change in existing TypeScript/JavaScript code
* [x] This wouldn't change the runtime behavior of existing JavaScript code
* [x] This could be implemented without emitting different JS based on the types of the expressions
* [x] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
* [x] This feature would agree with the rest of [TypeScript's Design Goals](https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals).


## ⭐ Suggestion

<!-- A summary of what you'd like to see added or changed -->

Generics should be able to be passed to the `Worker` interface defined in `lib.dom.d.ts`.

It should look something like this:

```ts
export interface Worker<Receive = any, Send = any, SendError = Send> extends EventTarget, AbstractWorker {
    onmessage: ((this: Worker, ev: MessageEvent<Send>) => any) | null;
    onmessageerror: ((this: Worker, ev: MessageEvent<SendError>) => any) | null;
    postMessage(message: Receive, transfer: Transferable[]): void;
    postMessage(message: Receive, options?: StructuredSerializeOptions): void;
	// ...
}
```

## 📃 Motivating Example

<!--
  If you were announcing this feature in a blog post, what's a short explanation that shows
  a developer why this feature improves the language?
-->

It would be nice to be able to type what data is be sent to and from an work.

## 💻 Use Cases

<!--
  What do you want to use this for?
  What shortcomings exist with current approaches?
  What workarounds are you using in the meantime?
-->

Writing typed web workers.
Repository: ant-design
Issue: Popover 在 react 17 场景未正常关闭
Labels: Inactive,improvement

### Reproduction link

[![Edit on CodeSandbox](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/hardcore-bouman-fnj56x)

### Steps to reproduce

点击 按钮1，Popover出现，再点击按钮2，按钮1触发的Popover未关闭

### What is expected?

按钮1触发的Popover关闭

### What is actually happening?

按钮1触发的Popover未关闭

| Environment | Info |
| --- | --- |
| antd | 4.19.3 |
| React | react 17 ，react 18  |
| System | mac |
| Browser | chrome |

---
受外层stopPropagation影响，实际是react 17变动了事件冒泡机制，但是antd未做相应的适配导致的，切换到react16 是ok的。希望能适配下。

<!-- generated by ant-design-issue-helper. DO NOT REMOVE -->
Repository: rust
Issue: Consider making `RemoveFalseEdges` a MIR phase
Labels: C-cleanup,T-compiler,A-MIR

Currently this is a [MIR pass](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir_transform/remove_false_edges/struct.RemoveFalseEdges.html). This comment from @ecstatic-morse suggests making it a [`MirPhase`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/enum.MirPhase.html).

https://github.com/rust-lang/rust/blob/6970f88db3ac2a9cefa9c585228291ae1f18fb04/compiler/rustc_mir_transform/src/remove_false_edges.rs#L10

<!-- TRIAGEBOT_START -->

<!-- TRIAGEBOT_ASSIGN_START -->

<!-- TRIAGEBOT_ASSIGN_DATA_START$${"user":null}$$TRIAGEBOT_ASSIGN_DATA_END -->

<!-- TRIAGEBOT_ASSIGN_END -->
<!-- TRIAGEBOT_END -->
Repository: rust
Issue: No syntactic way to specify GATs with where bounds in where clauses
Labels: GATs-triaged,A-GATs


Hi!

I was trying to use GATs in one of my projects, and ran into the following issue. 

```rust
#![feature(generic_associated_types)]

trait ModuleConfig {

    type Type1;

    type Type2<'a>
        where Self::Type1: 'a;

}

trait ModuleConfigSpec<T>
    where Self: for<'a> ModuleConfig<
        Type2<'a> = &'a T
        >,
{ }

fn main() {
    println!("Hello, world!");
}


```

This code does not compile, because the `for<'a>` bound in `ModuleConfigSpec` is not restricted by a `where Self::Type1: 'a`, which makes sense.
But as there is no way to specify this where bound, this means that GATs with where bounds cannot be passed to traits as concrete arguments. 
I expected it to be possible to specify where bounds locally for every GAT specified. Like in this case I expected to be able to write something like 
```

trait ModuleConfigSpec<T>
    where Self: ModuleConfig<
        for<'a> Type2<'a> = &'a T where Self::Type1: 'a,
        >,
{ }

```

Interestingly the code complies if we replace `trait ModuleConfigSpec` by 
```
fn takes_spec_module_config<M, T>() 
    where M: for<'a> ModuleConfig<
        Type2<'a> = &'a T
    >
{  }
```
which specifies the very same trait bounds.

### Meta

`rustc --version --verbose`:
```
rustc 1.61.0-nightly (5f3700105 2022-03-22)
```
Repository: godot
Issue: setget called on ready for exported array but not for simple var
Labels: discussion,topic:gdscript,documentation

### Godot version

3.4 stable, 3.5 beta1

### System information

linux

### Issue description

It seems that there is an inconsistency when the setter is called for a variable on startup.

When launching the project, the setter is called for an Array of String, but not for a simple String var.
I expect it to be either one or the other (I personally prefer it not being called at all on startup)

### Steps to reproduce

Create a Node2D

attach this script :
```gdscript
extends Node2D


export(Array, String) var test_arr setget set_test_arr
export var test = "baaa" setget set_test


func set_test_arr(value):
	print("array")
	test_arr = value


func set_test(value):
	print("string")
	test = value
```

Set the variables in the editor to any string you like.
Save and launch the scene

Only "array" prints, not "string"

### Minimal reproduction project

_No response_
Repository: vscode
Issue: Snippets disappear with `.` key
Labels: bug,snippets

<!-- ⚠️⚠️ Do Not Delete This! bug_report_template ⚠️⚠️ -->
<!-- Please read our Rules of Conduct: https://opensource.microsoft.com/codeofconduct/ -->
<!-- 🕮 Read our guide about submitting issues: https://github.com/microsoft/vscode/wiki/Submitting-Bugs-and-Suggestions -->
<!-- 🔎 Search existing issues to avoid creating duplicates. -->
<!-- 🧪 Test using the latest Insiders build to see if your issue has already been fixed: https://code.visualstudio.com/insiders/ -->
<!-- 💡 Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. -->
<!-- 🔧 Launch with `code --disable-extensions` to check. -->
Does this issue occur when all extensions are disabled?: Yes/No
Yes
<!-- 🪓 If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. -->
<!-- 📣 Issues caused by an extension need to be reported directly to the extension publisher. The 'Help > Report Issue' dialog can assist with this. -->
- VS Code Version: 1.65.2 (Universal)
- OS Version: OSX Monterey 12.3 (21E230)

Steps to Reproduce:

HTML/JSX snippets that include a `.` will disappear after the character is input:

<img width="1009" alt="Screen Shot 2022-03-24 at 6 37 09 PM" src="https://user-images.githubusercontent.com/74646/159888009-23904138-9961-4167-a5e4-6eef04c620a3.png">

<img width="710" alt="Screen Shot 2022-03-24 at 6 37 15 PM" src="https://user-images.githubusercontent.com/74646/159888017-cc383a47-feac-4b24-95a7-c3a8e566e3af.png">

This used to work in previous versions but seems to have stopped working with a recent update. I have ruled out Emmet as I have snippets turned off and the issue happens even with the extension disabled.
Repository: pytorch
Issue: String dtypes for torch Tensors
Labels: feature,triaged

### 🚀 The feature, motivation and pitch

To support strings as a dtype on torch tensors, similarily to how [TensorFlow](https://www.tensorflow.org/api_docs/python/tf/strings) does it. This will enrich the torch ecosystem and shouldn't mess with the previous dtypes. 

Right now there are many cases where strings are used in DL models and torch lack of support has resulted in some weird workarounds. The best example is [torchtext.vocab](https://pytorch.org/text/stable/vocab.html) which is used to encode strings to indexes, since torch doesn't support strings this method can only accept a list of strings and returns a tensor of integers. This behavior makes it hard to accommodate the layer in big systems as then the user needs to modify the datasets and dataloaders to return lists and not tensors (unwanted behavior). It also messes up with torchscript as we are now having two different datatypes on the graph, this will happen on the input side but also output side if we decode the index to string.

Tensorflow natively supports strings as dtype and has a similar layer to torchtext.vocab [tf.keras.StringLookup](https://www.tensorflow.org/api_docs/python/tf/keras/layers/StringLookup). This layer follows the same logic to index strings but it does all with tensor types. Meaning that is has a perfect integration with the rest of the TensorFlow ecosystem, contrary to torchtext.vocab.

This change will not only benefit the NLP community but also the Recommendation System community as many time ids for articles are string and this type of string indexing needs to happen ([example](https://www.tensorflow.org/recommenders/examples/quickstart) on TF recommenders where they use TF stringlookup layer).

I've work in teams were we used torch for research and model developing but when it came to productionizing the models we had to change to TensorFlow because of problems like this. tf.keras.stringlookup seemly allowed to embed the indexing in the model binary without any over complications.  I believe it is on torch roadmap to become more production friendly due to recent releases (torchscript, datapipes, etc) and this is a good step in that direction.

### Alternatives

I had to use tensorflow due to the lack of pytorch support of this feature

### Additional context

With my last employer H&M (the clothing brand) the lack of this feature alone made us move our models from torch to TF on production, many people use torch for experimentation but are slowly moving to TF.  

If contributors are needed, I'll be happy to help with this feature

_No response_