sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: pytorch
Issue: import problem
Labels: caffe2


I install the caffe2 using the command "conda install -c caffe2 caffe2-cuda8.0-cudnn7". In directory of xx/caffe2, there are the following folds/files:

contrib  core  distributed  experiments  __init__.py  __init__.pyc  perfkernels  proto  python

But when I execute
import caffe2
dir(caffe2)

It only shows the following results:
['__builtins__', '__doc__', '__file__', '__name__', '__package__', '__path__']
=====================================

Can anyone help solve this problem?

Thanks a lot.
















If you have a question or would like help and support, please ask at our
[forums](https://discuss.pytorch.org/).

If you are submitting a feature request, please preface the title with [feature request].
If you are submitting a bug report, please fill in the following details.

## Issue description

Provide a short description.

## Code example

Please try to provide a minimal example to repro the bug.
Error messages and stack traces are also helpful.

## System Info
Please copy and paste the output from our
[environment collection script](https://raw.githubusercontent.com/pytorch/pytorch/master/torch/utils/collect_env.py)
(or fill out the checklist below manually).

You can get the script and run it with:
```
wget https://raw.githubusercontent.com/pytorch/pytorch/master/torch/utils/collect_env.py
# For security purposes, please check the contents of collect_env.py before running it.
python collect_env.py
```

- PyTorch or Caffe2:
- How you installed PyTorch (conda, pip, source):
- Build command you used (if compiling from source):
- OS:
- PyTorch version:
- Python version:
- CUDA/cuDNN version:
- GPU models and configuration:
- GCC version (if compiling from source):
- CMake version:
- Versions of any other relevant libraries:
Repository: javascript-algorithms
Issue: Add B-Tree
Labels: enhancement

I would like to contriblute to adding the [B-Tree](https://en.wikipedia.org/wiki/B-tree) data structure.
It is a rather common data structure that is great for large data, I'll be glad to implement it.
Repository: opencv
Issue: Extend Python FFI bindings to adopt more languages
Labels: feature,category: build/install,RFC

It's not a bug report, but it's not a question too, so I think it's an appropriate place to write this proposal.

There is plenty of projects that are trying to implement FFI bindings to opencv, e.g. [this](https://github.com/hybridgroup/gocv) or [this](https://github.com/ruby-opencv/ruby-opencv) among many others. And they are just doing the same things over and over again.

But this repository has already great `gen2.py` that consider all edge cases and may be used to generate all required wrappers. But currently it requires some preinstalled software to be ran (e.g. numpy) as well as it generates python code which makes it hard to use for anything but python.

I have two proposals, the first one is easy to implement, the second is a bit more complicated, but has a great value

1. Create some target that would only generate python wrappers. It shouldn't check any environment dependencies, the only thing it should do is generate some code. That would allow other languages to use this code as an intermediate representation to generate their own wrappers
1. Make `gen2.py` (implement some new mechanism?) to generate more appropriate MIR (middle-level IR) and then generate python bindings from this representation. It requires more effort but it leads to great simplification for wrapper authors as well as it may be considered to be some kind of doogfooding where python bindings uses ther same MIR as others. It guarantees any FFI built on top of that would be full-featured and bugless, with all edge cases covered. The community effort would be focused in one place instead of being dissipated among multiple repositories trying to solve same issues over and over again

This would lead to better language adoption, more contributions, and more spreading overall.

I do believe it's the right way to do it and it's the high priority task for the repo. Let me provide a @berak 's  quote from our conversation:

> adapting a ~1000 lines python monster (which to 90% covers weird edge cases) might look daunting, but on the other hand, doing things [manually, like those folks](https://github.com/hybridgroup/gocv/) try will result in a "toy example", that only covers the 5% most used cases. (which again IS cool, too, don't get me wrong. problem is, if you deviate only a millimeter from it, you're staring into an open abyss)

We currently only have python and C++ code that works, and plenty of "toy examples" in others languages. I think it shall be changed.
Repository: pytorch
Issue: Document torch.acos() behavior near -1 and 1
Labels: module: docs,triaged

I created a network using torch.acos() and encountered a Nan error during its training.

The reason is that an input value to torch.acos () approaches 1 or -1, causing the grad to diverge, and resulting in value.grad = Nan.

I know that torch.acos () can only handle values ​​in the range from -1 to 1, and limited the input value's range from -1 to 1 using clamp(min=-1,max=1). However this error has occurred.
Finally I solved this by limiting input from -1 + eps to 1-eps with eps = 1e-7.

I think that many users would encounter this error.
I suggest "to alert this in the explanation of torch.acos() function in document" or "to change function to explicitly limit the range of values ​​by including eps as argument".
Repository: rust
Issue: Recursive trait constraints crash compiler with exit code 3221225501
Labels: A-trait-system,I-compiletime,T-compiler,I-compilemem,C-bug

I've got a crate that doesn't compile, it just starts eating memory until it stops without an error message. Only passing the `--verbose` flag to `cargo build` tells me
```
error: Could not compile `the-crate`.

Caused by:
  process didn't exit successfully: `rustc …` (exit code: 3221225501)
```
Seems to be the same exit code as in #42544.

Here's the (not exactly minimal) example to reproduce the issue:
```rs
pub struct Example<A, B, D>
where
    A: StrategyA<Example<A, B, D>>,
    B: StrategyB<Example<A, B, D>> {
    pub a: A,
    pub b: B,
    pub element: B::Element,
    pub data: D,
}
pub trait StrategyA<T: HasData> {
    fn do_a(&self, &T::Data);
}
pub trait StrategyB<T> {
    type Element;
    fn do_b(&self, &T);
}
impl<A: StrategyA<Self>, B: StrategyB<Self>, D> Example<A, B, D> {
    pub fn do_it(&self, args: bool) {
        if args {
            self.a.do_a(self.get_data());
        } else {
            self.b.do_b(self);
        }
    }
}
pub trait HasData {
    type Data;
    fn get_data(&self) -> &Self::Data;
}
impl<A: StrategyA<Self>, B: StrategyB<Self>, D> HasData for Example<A, B, D> {
    type Data = D;
    fn get_data(&self) -> &D {
        &self.data
    }
}

pub struct ExampleA;
pub struct ExampleB;
pub struct ExampleData;

impl<E: HasData<Data=ExampleData>> StrategyA<E> for ExampleA {
    fn do_a(&self, e: &ExampleData) {
        e; // using ExampleData here
    }
}
impl<E: HasData<Data=ExampleData>> StrategyB<E> for ExampleB {
    type Element = ExampleData;
    fn do_b(&self, e: &E) { /* same */}
}

fn x() {
    let example = Example { a: ExampleA, b: ExampleB, data: ExampleData };
    example.sized.do_it(true);
    example.sized.do_it(false);
}
```
Removing the `StrategyA` parts causes it to produce an "overflow evaluating the requirement …" error, not sure whether related.
Repository: flutter
Issue: Changing build folder destination issue ( .flutter_settings file)
Labels: c: new feature,tool,P2,team-tool,triaged-tool

In native android development we can change the build folder destination adding the line below to the project "build.gradle" file:

```
allprojects {
    repositories {
      ...
    }
    buildDir = "C:/dev_build/android/${rootProject.name}/${project.name}"
}
```
With Flutter I tried @cbracken instructions to create the `.flutter_settings` file at the home folder with this content: `{"build-dir": "somePath"}` and I found the following issues:

- It affects all flutter projects.
- The path have to be relative or we get an exception
- The path have to exist beforehand  or we get an exception
- After an complete build I found only 3 files in this new path: `frontend_server.d`, `app.dill` and `app.dill.incremental.dill`. All the others files went to the default "build" folder inside the project.

Ideally, I think, it should (as in native android):

1. Have an absolute path support
2. Create the path when it does not exist.
3. Have some way to interpolate the project name into the path
4. Be a by project configuration.

The reasons to change the build destination that I can think of are:
1. To avoid polluting the project folder with generated files
2. To avoid copying the build files (>300MB) when doing a backup of the project folder
3. To avoid wearing out a SSD when the project is in one
4. Put the build files on a faster device to reduce building time

I know that this is not a priority issue for now but it would be nice to have it visited in a near future.

By the way, congratulations on building this amazing framework. I'm really loving Flutter.
 
`flutter build apk --verbose` -->[build.log](https://github.com/flutter/flutter/files/2065002/build.log)
Repository: rust
Issue: Unable to make a function for write!ing that is generic over a File or String
Labels: C-enhancement,T-lang,T-libs-api

write! duck types to calling write_fmt() which happens to work on both std::io::Write and std::fmt::Write. Unfortunately because std::io::Write does not implement std::fmt::Write you can't write a generic function that would accept either a File or String.

One would want to be able to write something like:

```rust
fn write_some_stuff<W: std::fmt::Write>(writer: &mut W) {
   write!(writer, "Hello world");
}
```

and be able to pass that function a reference to a File or a String.
Repository: ant-design
Issue: Menu item grouping and alignment
Labels: Inactive

- [x] I have searched the [issues](https://github.com/ant-design/ant-design/issues) of this repository and believe that this is not a duplicate.

Someone else has requested something similar [1] but the response to that request was hijacked by text alignment (which is not what this is about) and then sadly closed for inactivity...

[1] https://github.com/ant-design/ant-design/issues/6111 

### What problem does this feature solve?
The ability to group menu items in a Menu with `mode=horizontal` so that these item groups can be aligned `left` (default) or `right`. It's common for applications to have an Account or Logout option in the top right corner of a main navigation where access to application features might live on the left in the top navigation. There is currently no mechanism to a) divide the top level nav into multiple item groups and b) align these item groups either left or right.


### What does the proposed API look like?
Using the Top Side 2 demo as an example (https://github.com/ant-design/ant-design/blob/master/components/layout/demo/top-side-2.md).

The Menu in the Header would have the ability to group the menu items and then align each group accordingly:

    <Header className="header">
      <div className="logo" />
      <Menu
        theme="dark"
        mode="horizontal"
        defaultSelectedKeys={['11']}
        style={{ lineHeight: '64px' }}
      >
        <Menu.Group> <!-- "align=left" is implied -->
          <Menu.Item key="10">nav 1</Menu.Item>
          <Menu.Item key="11">nav 2</Menu.Item>
          <Menu.Item key="12">nav 3</Menu.Item>
        </Menu.Group>
        <Menu.Group align="right">
          <Menu.Item key="20">Account</Menu.Item>
          <Menu.Item key="21">Logout</Menu.Item>
        </Menu.Group>
      </Menu>
    </Header>

I guess for completness it would also be possible to have `align=center` to display the group of items in the centre of the menu. Obviously, this proposal only makes sense for Menu's with `mode=horizontal`.


<!-- generated by ant-design-issue-helper. DO NOT REMOVE -->
Repository: rust
Issue: Tracking issue for #[doc(keyword = "...")]
Labels: T-rustdoc,B-unstable,C-tracking-issue,S-tracking-perma-unstable

Implemented in #51140.
Repository: three.js
Issue: FBXLoader messes the animation up
Labels: Bug,Loaders

I dont really know why, but this model here looks like this if animated:
![screen shot 2018-06-03 at 2 02 30](https://user-images.githubusercontent.com/242577/40881564-3d91e5aa-66d2-11e8-84f6-e09993d81bef.png)

It does work perfectly fine in [autodesk fbx review](https://www.autodesk.com/products/fbx/fbx-review). There are warnings of dropped weights, and some vertices appear to have as much as 12 influences according to FBXLoader, however it is hard to believe that is the cause (hello #12127) and also previous revisions of the same model in dae format had no such problem.
[Head_69.fbx.zip](https://github.com/mrdoob/three.js/files/2065468/Head_69.fbx.zip)
Repository: godot
Issue: Make special C# cases for APIs like get_property_list which return a list of dictionaries.
Labels: enhancement,topic:core,topic:dotnet

Just throwing an idea out there, really.

The API for `get_property_list` return an *array of dictionaries*, probably to avoid having to declare a new type for a single function. This is *fine* in dynamically typed languages because there's little difference between `x.y` and `x["y"]`, but it's awful in typed languages like C#. It just makes the API extremely prone to "great what was the exact layout again", because Intellisense becomes useless.

So, I suggest that since C# is still marked unstable, **we refactor these to handle some simple immutable classes/structs**. Shouldn't be too far off the regular API, but still be tons more usable.

Thoughts?
Repository: create-react-app
Issue: Create React App removes SSI directives on Build from index.html
Labels: issue: proposal

I'm trying to add some SSI directives in the index.html so that I can return dynamic meta tags based on the current url. I'm doing this to solve the Facebook Meta Tag issue. Below is the snippet of the if-condition I've added in the index.html.

`<!--#if expr="$DOCUMENT_URI = /movie-review\/(.*)/" -->`

But, realized that the create-react-app seems to delete them on build. The final built index.html is minified and does not have any comments on them. Since SSI directives syntax is similar to html comments, create-react-app is removing them. Is there any way to skip removing them on build? If no, then what other possible solutions exist to solve the dynamic meta tag problem for react app served on apache server?
Repository: neovim
Issue: win: failed assertion "_osfile(fh) & FOPEN" during debugging
Labels: bug,platform:windows,system

- `nvim --version`: f711b635133f
- Operating system/version: Windows 7 32-bit

### Steps to reproduce using `nvim -u NORC`

1. Using the Visual Studio 2017 [build steps](https://github.com/neovim/neovim/wiki/Building-Neovim#windows--msvc), build Nvim with the `x86-Debug` configuration.
2. Use the Visual Studio debugger to start `nvim.exe` .
3. The execution fails in `fopen_noinh_readbin .. fdopen` with an assertion error: `_osfile(fh) & FOPEN` .

### Notes

There is [this old libuv issue](https://github.com/joyent/libuv/issues/1493) but the problem may just be a [race](https://www.gamedev.net/forums/topic/449745-_osfilefh--fopen-assertion-for-future-ref/).

Need more investigation.
Repository: pytorch
Issue: manager.cpp:64: undefined reference to `shm_open (when building with GCC 5.x (sic))
Labels: module: build,triaged

I attempted to build with GCC 5.x on Linux and the "do I have to link against rt" logic doesn't seem to work correctly:

```
CMakeFiles/torch_shm_manager.dir/manager.cpp.o: In function `object_exists(char const*)':
/home/ezyang/Dev/pytorch-tmp/torch/lib/libshm/manager.cpp:64: undefined reference to `shm_open'
CMakeFiles/torch_shm_manager.dir/manager.cpp.o: In function `main':
/home/ezyang/Dev/pytorch-tmp/torch/lib/libshm/manager.cpp:157: undefined reference to `shm_unlink'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
```

cc @malfet @seemethere @walterddr
Repository: pytorch
Issue:  Please provide wheel package for windows on PyPI
Labels: module: binaries,triaged

Hi,
I am a pytorch user on windows, and saw pytorch wheel package for windows on the official site. Would you please also put the win-amd64 wheel package on PyPI, so we can download it easily using "pip install pytorch".
Thanks.
Repository: pytorch
Issue: load_state_dict unexpectedly does not load Tensor to buffers that currently have None value
Labels: module: bc-breaking,module: docs,module: nn,triaged

## Issue description

I have some model variations that learn a certain value, while others keep this value fixed. For this purpose I'd like to have a None-able buffer that stores the fixed value and have this value included in the state dict for serialization. The  [`_load_from_state_dict` function](https://github.com/pytorch/pytorch/blob/master/torch/nn/modules/module.py#L626) in the Module class however doesn't overwrite buffers and parameters that currently have the None value. I didn't expect this, leading to a bug in my code.

Although this was unexpected behaviour for me, I understand that this could be desired. In that case perhaps it can be included in the docs.

## Code example
```
import torch
import torch.nn as nn


class X(nn.Module):
    def __init__(self, buf):
        super().__init__()
        self.register_buffer('buffer', buf)


x = X(torch.tensor(1.))
state = x.state_dict()

y = X(torch.tensor(2.))
y.load_state_dict(state)  # Works fine

z = X(None)
z.load_state_dict(state)

# Raises:
# RuntimeError: Error(s) in loading state_dict for X:
# 	Unexpected key(s) in state_dict: "buffer".
```
## System Info
```
PyTorch version: 0.4.0
Is debug build: No
CUDA used to build PyTorch: 9.1.85

OS: Ubuntu 18.04 LTS
GCC version: (Ubuntu 7.3.0-16ubuntu3) 7.3.0
CMake version: version 3.10.2

Python version: 3.6
Is CUDA available: Yes
CUDA runtime version: Could not collect
GPU models and configuration: GPU 0: GeForce GTX 1080 Ti
Nvidia driver version: 390.48
cuDNN version: Probably one of the following:
/usr/lib/x86_64-linux-gnu/libcudnn.so.7.1.3

Versions of relevant libraries:
[pip] numpy (1.14.3)
[pip] torch (0.4.0)
[pip] torchvision (0.2.1)
[conda] Could not collect
```


cc @ezyang @SsnL @gchanan
Repository: godot
Issue: ERROR: set_data: Condition ' len % 2 ' is true
Labels: bug,topic:physics

commit hash: 8684b631182dffebba27bdf538129818321d0d7d

I'm getting a lot of those errors when dynamically changing the array of segments in ConcavePolygonShape2D (adding points). Collisions on some of the segments don't work. Errors are from `servers/physics_2d/shape_2d_sw.cpp:910`.

What does this error mean?
Repository: pytorch
Issue: Export CC is ignored when I build pytorch
Labels: module: build,triaged

Hi, I tried to build pytorch from source but I knew that it couldn't be compiled with gcc 8 because nccl fails to compile with gcc 8. When I was compiling caffe2 I fixed this issue with compiling gcc 7.3 and installing it under /usr/local/ and exporting CC and CXX and then compiling caffe2. But when I export CC and CXX and then run setup.py it ignores the variables and compiles with gcc8 and fails to compile. these are the commands used:

export CC=/usr/local/gcc-73/bin/gcc73
export CXX=/usr/local/gcc-73/bin/g++73

sudo python setup.py install

OS: fedora 28
GCC: gcc (GCC) 8.1.1 20180502 (Red Hat 8.1.1-1)
Version: I couldn't find pytorch's version in the source dir but caffe's version is 0.8.2

cc @malfet @seemethere @walterddr
Repository: puppeteer
Issue: Feature request: create isolated world
Labels: feature,upstream,chromium,P2

I'd like to create an isolated context to execute some js in the same website I'm visiting without polluting the main context. It is possible right now, but it requires to access a lot of internal methods:

      const mainFrame = page.mainFrame()

      const isolatedWorldInfo = await page._client.send('Page.createIsolatedWorld', {frameId: mainFrame._id, worldName: 'new-isolated-world'})
      const executionContextId = isolatedWorldInfo.executionContextId
      const JsHandleFactory = page._frameManager.createJSHandle.bind(page._frameManager, executionContextId)

      const executionContext = new ExecutionContext(page._client, {id: executionContextId}, JsHandleFactory)
      await executionContext.evaluate(..)


It would be nice if puppeteer exposed this as a method. Something like: page.createNewIsolatedContext

If necessary I could write up the code and the tests
Repository: angular
Issue: Bug(Animations): animation transition :enter delay should delay the appearance of an element
Labels: area: animations,freq2: medium,P4,bug

## I'm submitting a...
<!-- Check one of the following options with "x" -->
<pre><code>
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  <!-- Please search GitHub for a similar issue or PR before submitting -->
[ ] Performance issue
[x] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
[ ] Other... Please describe:
</code></pre>

## Current behavior
<!-- Describe how the issue manifests. -->
Animation delay does not delay element appearance during `:enter` transition

## Expected behavior
<!-- Describe what the desired behavior would be. -->
Animation delay should delay appearance of an element during `:enter` transition

## What is the motivation / use case for changing the behavior?
<!-- Describe the motivation or the concrete use case. -->
It's not possible to animate the `display` property which makes it impossible in some cases to delay the appearance of an object using Angular's animation features.

## Environment

<pre><code>
Angular version: 6.0.3
<!-- Check whether this is still an issue in the most recent Angular version -->

Browser:
- [ ] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
 
For Tooling issues:
- Node version: XX  <!-- run `node --version` -->
- Platform:  <!-- Mac, Linux, Windows -->

Others:
<!-- Anything else relevant?  Operating system version, IDE, package manager, HTTP server, ... -->
</code></pre>