sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: pytorch
Issue: Allow `__array__` to automatically detach and move to CPU
Labels: feature,module: cuda,triaged,module: numpy

## 🚀 Feature

I would like `__array__` to always implicitly detach and transfer to CPU before returning a numpy array, so that `np.asarray(mytensor)` is guaranteed to work.

## Motivation

For good reasons detailed in [this Discourse thread](https://discuss.pytorch.org/t/should-it-really-be-necessary-to-do-var-detach-cpu-numpy/35489), a `torch.Tensor` with gradients needs to be `.detach()`ed before it is converted to NumPy, and further, if the Tensor is on the GPU it needs to be explicitly transferred back. Specifically:

> People not very familiar with `requires_grad` and cpu/gpu Tensors might go back and forth with numpy. For example doing pytorch -> numpy -> pytorch and backward on the last Tensor. This will backward without issue but not all the way to the first part of the code and won’t raise any error.

As someone not very familiar with `requires_grad`, I am fully on board with this. :sweat_smile: 

However, the purpose of `__array__` is to allow functions to be written against a unique API (NumPy) to work on arrays of other types *without having to know anything about said array*. Having to go through `.detach()[.cpu()]` breaks this assumption.

## Pitch

The specific use case I have in mind is viewing tensors. In [napari](https://napari.org), we pass input arrays through `__getitem__` and then through `np.asarray`, which lets us lazily view n-dimensional arrays as long as they satisfy the `__array__` API. This works for NumPy, dask, zarr, and Xarray, but I stumbled when I was trying to demo it with torch Tensors. You can see a brief demo in this noise2self notebook:

https://github.com/jni/noise2self/blob/napari/notebooks/Intro%20to%20Neural%20Nets.ipynb

(You need the usual suspects, plus `pip install napari` or `conda install -c conda-forge napari` for the viewer.)

![pytorch](https://user-images.githubusercontent.com/492549/79187638-73606700-7de2-11ea-977e-114041d76c8f.gif)

## Alternatives

Things could remain as is, and there are advantages (articulated in the Discourse post). However, this means that anyone else in the NumPy ecosystem that wants to play well with `torch.Tensor`s then needs to include PyTorch-specific code in their code base, which is not super nice. (Or monkey-patch it, which is also not super nice!)

## Additional context

original `__array__` proposal: #2935
original `__array__` implementation: #2945
possibly related issue: #9648

I couldn't find too much discussion on the issues or PRs about the decision not to `.detach()` automatically in `__array__`.

cc @ngimel
Repository: vscode
Issue: Support "perspectives" like approach in VSCode 
Labels: feature-request,layout

<!-- ⚠️⚠️ 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. -->

**What is a Perspective?**
https://www.tutorialspoint.com/eclipse/eclipse_perspectives.htm
https://www.eclipse.org/articles/using-perspectives/PerspectiveArticle.html

Considering large projects with different components (backend, frontend  projects with mix of languages) a feature similar to Eclipse IDE "perspectives" would be very useful to easy switch between the projects or scope to a section of the current project. To switch between the perspectives, a ui similar to open recent (Ctrl-R) project could be used and triggered with a shortcut (Ctrl-9). The icon in each entry can show the project's main technology (angular, c#, etc).

In the File Explorer (VSCode's Tab) a new context menu option "Create Perspective" is used to add perspectives based on a folder.

In the Sidebar a new item can be added named "Perspectives" that can list the existing perspectives with a highlight on the active one. A color can be used in the ui sidebar item or a status bar indicator similar to "Open Remote Window" with the name of the current perspective, at click will open Ctrl-9 ui mentioned above.

(Each perspective can have a picked color like in peakoc.)

**If accepted this feature can extend the functions that are now present in the "remote connect" feature and maybe not generating another item in the status bar.**



![image](https://user-images.githubusercontent.com/37976898/79321063-76a74000-7f13-11ea-9701-a1799df1db4b.png)
 

Benefits:
- large projects can be easier managed on each component (eg: backend perspective, web app perspective, mobile app perspective)
- scope to section in same project / perspective with  "Create Perspective"
- keeps the same window but switches the workspace (no alt-tab jumps)
- keeps the same simple/clean layout (no need for multiple sidebars clutter)
Repository: youtube-dl
Issue: Add on24 downloader
Labels: site-support-request

## Checklist

- [x] I'm reporting a feature request
- [x] I've verified that I'm running youtube-dl version **2020.03.24**
- [x] I've searched the bugtracker for similar feature requests including closed ones


## Description

ON24 is used for online trainings like from the O'Reilly learning platform. Replays are available after the training but it seems they cannot be downloaded. I'd like to ask for a download functionality.
Repository: opencv
Issue: CvCapture_FFMPEG::open blocked
Labels: feature,priority: low,category: videoio,incomplete,needs reproducer,needs investigation

##### System information (version)
- OpenCV => 4.1.2
- Operating System / Platform => centos 7
- Compiler => gcc 4.8

##### Detailed description

CvCapture_FFMPEG::open will blocked when another thread also blocked in CvCapture_FFMPEG:: open.
I checked related code as follow, it seems the _mutext lock hold too much time:
cap_ffmpeg_impl.hpp:890
```
bool CvCapture_FFMPEG::open( const char* _filename )
{
    InternalFFMpegRegister::init();
    AutoLock lock(_mutex);
    unsigned i;
    bool valid = false;

```
Repository: youtube-dl
Issue: aShemaletube site support request
Labels: site-support-request

<!--

######################################################################
  WARNING!
  IGNORING THE FOLLOWING TEMPLATE WILL RESULT IN ISSUE CLOSED AS INCOMPLETE
######################################################################

-->


## Checklist

<!--
Carefully read and work through this check list in order to prevent the most common mistakes and misuse of youtube-dl:
- First of, make sure you are using the latest version of youtube-dl. Run `youtube-dl --version` and ensure your version is 2020.03.24. If it's not, see https://yt-dl.org/update on how to update. Issues with outdated version will be REJECTED.
- Make sure that all provided video/audio/playlist URLs (if any) are alive and playable in a browser.
- Make sure that site you are requesting is not dedicated to copyright infringement, see https://yt-dl.org/copyright-infringement. youtube-dl does not support such sites. In order for site support request to be accepted all provided example URLs should not violate any copyrights.
- Search the bugtracker for similar site support requests: http://yt-dl.org/search-issues. DO NOT post duplicates.
- Finally, put x into all relevant boxes (like this [x])
-->

- [X] I'm reporting a new site support request
- [X] I've verified that I'm running youtube-dl version **2020.03.24**
- [X] I've checked that all provided URLs are alive and playable in a browser
- [X] I've checked that none of provided URLs violate any copyrights
- [X] I've searched the bugtracker for similar site support requests including closed ones but no one has responded to open one from 2018


## Example URLs

<!--
Provide all kinds of example URLs support for which should be included. Replace following example URLs by yours.
-->

- Single video: https://www.ashemaletube.com/videos/546887/new-tits-small-dick/
- Single video: https://www.ashemaletube.com/videos/546887
- Playlist: https://www.ashemaletube.com/playlists/419877/
- Model: https://www.ashemaletube.com/model/nbnabunny-6405/

## Description

<!--
Provide any additional information.
If work on your issue requires account credentials please provide them or explain how one can obtain them.
-->

You can find the direct video url from a page by finding this:

`<video preload="metadata" src="https://cdn.ashemaletube.com/key=HPSi85Yj4gniNhbBLE4PmA,end=1586860341/ip=0.0.0.0/speed=381694/buffer=3.0/2020-04/hq_69b0dff5baab7f3f242fcce17e6ab04c.mp4" playsinline="null" style="width: 990px; height: 557px;"></video>`

(From: https://www.ashemaletube.com/videos/546887/new-tits-small-dick/ and `ip=` was changed from my actual IP to 0.0.0.0)

Sometimes you're required to login to view some videos. 
Username: `Nourins`
Password: `3y9C34a32!HwgCvR^Xi@328rJCqfMB&C`
Repository: pytorch
Issue: Libtorch build error when setting both `USE_GLOO` and `USE_SYSTEM_NCCL` to `ON`
Labels: oncall: distributed,module: build,module: docs,triaged,module: nccl

## 🐛 Bug

Currently when setting `USE_GLOO` cmake option to `ON`, target `gloo_cuda` requires a dependency called `nccl_external`; however, this target is avaliable if and only if `USE_SYSTEM_NCCL` is `OFF`. Thus if both `USE_GLOO` and `USE_SYSTEM_NCCL` is set to `ON` cmake would report error during configuration phase.

https://github.com/pytorch/pytorch/blob/master/cmake/Dependencies.cmake#L1149
https://github.com/pytorch/pytorch/blob/master/cmake/External/nccl.cmake#L19

## To Reproduce

Steps to reproduce the behavior:

1. run `cmake -DBUILD_PYTHON=OFF -DUSE_CUDA=ON -DUSE_CUDNN=ON -DUSE_NCCL=ON -DUSE_SYSTEM_NCCL=ON -DUSE_DISTRIBUTED=ON -DUSE_GLOO=ON /path/to/torchsrc`

2. CMake will then report the following error:
    ```
    -- Configuring done
    CMake Error at cmake/Dependencies.cmake:1149 (add_dependencies):
      The dependency target "nccl_external" of target "gloo_cuda" does not exist.
    Call Stack (most recent call first):
      CMakeLists.txt:421 (include)


    -- Generating done
    CMake Generate step failed.  Build files cannot be regenerated correctly.
    ```

## Expected behavior

The configuration step should be executed without problem

## Environment

* OS: CentOS 7 x86_64 with `devtoolset-6` enabled
* CMake version: 3.17.0
* Cuda version: 9.2.148-1
* CuDNN version: libcudnn7-7.6.5.31-1.cuda9.2
* NCCL version: 2.4.8-ga-cuda9.2-1-1

All of Cuda, CuDNN and NCCL libraries are installed through NVIDIA's offical rpm package; no libtorch were installed before.

I've tried using current master HEAD and tag/v1.5.0-rc3 and the problem still exists.

## Additional context

Related commit seems to be https://github.com/pytorch/pytorch/commit/30da84fbe1614138d6d9968c1475cb7dc459cd4b

cc @pietern @mrshenli @pritamdamania87 @zhaojuanmao @satgera @rohan-varma @gqchen @aazzolini @xush6528 @osalpekar
Repository: rust
Issue: Semantics of MIR function calls
Labels: T-lang,A-MIR,A-miri

Some discussion at https://github.com/rust-lang/rust/pull/71005#issuecomment-612242397 revealed that we are not entirely sure what exactly the semantics of passing arguments and return values for function calls should be.

The simplest possible semantics is to say that when a stack frame is created, we allocate fresh memory for all arguments and return values (according to the known layout, determined by the callee). We copy the function arguments into the argument slots. Then we evaluate the function, and when it returns, we copy the return value back.

However, such a model is hard to compile down to destination-passing style, where the callee actually writes its return value directly into caller-provided memory. If that aliases with other things the function can access, behavior could differ with and without destination-passing style. This is complicated by the fact that in MIR right now a `Call` does not provide a return place, but even with destination-passing style diverging functions (without a return place) may access their return local `_0` . Moreover @eddyb says that also for some function arguments, we might want to elide the copy during codegen; it is unclear whether that is behaviorally equivalent to the above copying semantics or not.

This is something of a sibling to https://github.com/rust-lang/rust/issues/68364. We should have a good way to collect all these "MIR semantics" issues...
Repository: TypeScript
Issue: Workspace Symbol Provider called with empty string doesn't return all workspace symbols
Labels: Bug

<!-- 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨

Half of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker. Even if you think you've found a *bug*, please read the FAQ first, especially the Common "Bugs" That Aren't Bugs section!

Please help us by doing the following steps before logging an issue:
  * Search: https://github.com/Microsoft/TypeScript/search?type=Issues
  * Read the FAQ: https://github.com/Microsoft/TypeScript/wiki/FAQ

Please fill in the *entire* template below.
-->

<!--
Please try to reproduce the issue with the latest published version. It may have already been fixed.
For npm: `typescript@next`
This is also the 'Nightly' version in the playground: http://www.typescriptlang.org/play/?ts=Nightly
-->
**TypeScript Version:**  3.8.3

<!-- Search terms you tried before logging this (so others can find this issue more easily) -->
**Search Terms:** Workspace Symbol Provider executeWorkspaceSymbolProvider

Running this code from vscode extension:
**Code**

```ts
const allSymbols = await commands.executeCommand('vscode.executeWorkspaceSymbolProvider', '');
console.log(allSymbols);// []
```

**Expected behavior:**

All the symbols in workspace returned

**Actual behavior:**

An empty array returned

---

Workspace symbol provider says empty string should return all symbols.

```ts
/**
 * Project-wide search for a symbol matching the given query string.
 *
 * The `query`-parameter should be interpreted in a *relaxed way* as the editor will apply its own highlighting
 * and scoring on the results. A good rule of thumb is to match case-insensitive and to simply check that the
 * characters of *query* appear in their order in a candidate symbol. Don't use prefix, substring, or similar
 * strict matching.
 *
 * To improve performance implementors can implement `resolveWorkspaceSymbol` and then provide symbols with partial
 * [location](#SymbolInformation.location)-objects, without a `range` defined. The editor will then call
 * `resolveWorkspaceSymbol` for selected symbols only, e.g. when opening a workspace symbol.
 *
 * @param query A query string, can be the empty string in which case all symbols should be returned.
 * @param token A cancellation token.
 * @return An array of document highlights or a thenable that resolves to such. The lack of a result can be
 * signaled by returning `undefined`, `null`, or an empty array.
 */
```

Redirected from https://github.com/microsoft/vscode/issues/94770
Repository: pytorch
Issue: [1.4.1] cmake3 not found
Labels: module: build,triaged

On CentOS7 the cmake 3 binary is called cmake3, but at the build for pytorch only an call to cmake is done. But cmake is not installed,
'which cmake3' will find the path to it.
As I see in the source code of pytorch, there is some code to find cmake3, but it looks like it will nor work.
```
 which cmake3
/usr/bin/cmake3
+ CFLAGS='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic'
+ LDFLAGS='-Wl,-z,relro '
+ /usr/bin/python3 setup.py build '--executable=/usr/bin/python3 -s'
Building wheel torch-1.4.0a0
-- Building version 1.4.0a0
cmake -DBUILD_PYTHON=True -DBUILD_TEST=True -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/builddir/build/BUILD/torch-1.4.1/torch -DCMAKE_PREFIX_PATH=/usr/lib/python3.6/site-packages -DPYTHON_EXECUTABLE=/usr/bin/python3 -DPYTHON_INCLUDE_DIR=/usr/include/python3.6m -DPYTHON_LIBRARY=/usr/lib64/libpython3.6m.so.1.0 -DTORCH_BUILD_VERSION=1.4.0a0 -DUSE_NUMPY=True /builddir/build/BUILD/torch-1.4.1
Traceback (most recent call last):
  File "setup.py", line 755, in <module>
    build_deps()
  File "setup.py", line 316, in build_deps
    cmake=cmake)
  File "/builddir/build/BUILD/torch-1.4.1/tools/build_pytorch_libs.py", line 59, in build_caffe2
    rerun_cmake)
  File "/builddir/build/BUILD/torch-1.4.1/tools/setup_helpers/cmake.py", line 319, in generate
    self.run(args, env=my_env)
  File "/builddir/build/BUILD/torch-1.4.1/tools/setup_helpers/cmake.py", line 141, in run
    check_call(command, cwd=self.build_dir, env=env)
  File "/usr/lib64/python3.6/subprocess.py", line 306, in check_call
    retcode = call(*popenargs, **kwargs)
  File "/usr/lib64/python3.6/subprocess.py", line 287, in call
    with Popen(*popenargs, **kwargs) as p:
  File "/usr/lib64/python3.6/subprocess.py", line 729, in __init__
    restore_signals, start_new_session)
  File "/usr/lib64/python3.6/subprocess.py", line 1364, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'cmake': 'cmake'
```
Repository: electron
Issue: NativeWindowViews::SetFocusable should call SetSkipTaskbar conditionally
Labels: enhancement :sparkles:

<!--  As an open source project with a dedicated but small maintainer team, it can sometimes take a long time for issues to be addressed so please be patient and we will get back to you as soon as we can.
-->

### Preflight Checklist
<!-- Please ensure you've completed the following steps by replacing [ ] with [x]-->

* [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 for a feature request that matches the one I want to file, without success.

### Problem Description
<!-- Is your feature request related to a problem? Please add a clear and concise description of what the problem is. -->
SetFocusable shows the app at the taskbar because it also resets the skipTaskbar flag. Calling SetSkipTaskbar afterwards removes the app from the taskbar again but this results in a unwanted flickering of the taskbar.

```
void NativeWindowViews::SetFocusable(bool focusable) {
  widget()->widget_delegate()->SetCanActivate(focusable);
#if defined(OS_WIN)
  LONG ex_style = ::GetWindowLong(GetAcceleratedWidget(), GWL_EXSTYLE);
  if (focusable)
    ex_style &= ~WS_EX_NOACTIVATE;
  else
    ex_style |= WS_EX_NOACTIVATE;
  ::SetWindowLong(GetAcceleratedWidget(), GWL_EXSTYLE, ex_style);
  SetSkipTaskbar(!focusable); // <- conditionally 
  Focus(false);
#endif
}
```

### Proposed Solution
<!-- Describe the solution you'd like in a clear and concise manner -->
Add a second parameter (updateSkipTaskbar) to SetFocusable with a default value to keep the current behavior and do not call SetSkipTaskbar if set.

### Alternatives Considered
<!-- A clear and concise description of any alternative solutions or features you've considered. -->
Patching Electron

### Additional Information
<!-- Add any other context about the problem here. -->
This problem occurs on Windows.
Repository: pytorch
Issue: One confusion about the CompilationUnit destructuring process in torch/jit/__init__.py 
Labels: oncall: jit,triaged

hi,  my friends

  I have one confusion about the destructuring process of the CompilationUnit object in torch/jit/__init__.py file:
       _python_cu = torch._C.CompilationUnit()
  As i know, many shared_ptr pointers has pointed this CompilationUnit object in pytorch jit. When no shared_ptr pointers have pointed it, this CompilationUnit object will be destructured. I have developed a c++ extension module of pytorch, when the program exits, I find the Compilation object has different destructive behavior. Sometimes it will firstly destruct the shared_ptr pointer of CompilationUnit object in pybind11::class_<torch::jit::script::CompilationUnit, std::shared_ptr<torch::jit::script::CompilationUnit>>::dealloc() of third_party/pybind11/include/pybind11/pybind11.h, then this CompilationUnit object will be destructed. However, sometimes it will not enter the pybind11::class_<>::dealloc() function when the program exists, this will cause this CompilationUnit object can't be destructed because one shared_ptr pointer in pybind11.h still point this object. 

  I don't know why different destructuring process occurs for different running. I would appreciate it it you can give me some advice for this problem. Thanks.


cc @suo
Repository: godot
Issue: Creating new plugin C# doesn't create the correct file
Labels: enhancement,topic:editor,topic:dotnet

**Godot version:**
3.2.1 stable mono
**OS/device including version:**
Debian 10
**Issue description:**
Following the instruction from documentation [here](https://docs.godotengine.org/en/stable/tutorials/plugins/editor/making_plugins.html) Godot does not create the correct file:
```
using Godot;
using System;

public class plugin : EditorPlugin
{
    // Declare member variables here. Examples:
    // private int a = 2;
    // private string b = "text";

    // Called when the node enters the scene tree for the first time.
    public override void _Ready()
    {
        
    }

//  // Called every frame. 'delta' is the elapsed time since the previous frame.
//  public override void _Process(float delta)
//  {
//      
//  }
}
```

Expected:
```
#if TOOLS
using Godot;
using System;

[Tool]
public class CustomNode : EditorPlugin
{
    public override void _EnterTree()
    {
        // Initialization of the plugin goes here
    }

    public override void _ExitTree()
    {
        // Clean-up of the plugin goes here
    }
}
#endif
```

**Steps to reproduce:**
follow the instructions on the page
**Minimal reproduction project:**
NA
Repository: pytorch
Issue: Add load_state_dict and state_dict() in C++
Labels: module: cpp,triaged

## 🚀 Feature
I would be able to clone a model into another model. Such as being done in the [Reinforcement Learning (DQN) Tutorial](https://pytorch.org/tutorials/intermediate/reinforcement_q_learning.html) at **Training**.

The requested functions that do exist in python but not C++ are:
```
load_state_dict()
state_dict()
target_net.load_state_dict(policy_net.state_dict())
```

## Motivation
It would be neat to be able to follow the pytorch example listed above. However the C++ library are missing the necessary functions for doing this.


cc @yf225