WhereIsAI/github-issue-similarity huggingface dataset:
Issue 1:
I'm getting this unexpected error on pytorch nightly (1.8.0.dev20201025) when I subclass Tensor and call new_ones on an instance of my subclass.

To Reproduce

from torch import Tensor

class MyTensor(Tensor):
pass

a = MyTensor([1,2,3])
a.new_ones(320)

Expected result

A tensor of 320 ones.

Actual result

---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-3-75c7d48cef15> in <module>
5
6 a = MyTensor([1,2,3])
----> 7 a.new_ones(320)

~/anaconda3/envs/sped3090/lib/python3.7/site-packages/torch/tensor.py in __torch_function__(cls, func, types, args, kwargs)
1022
1023 with _C.DisableTorchFunction():
-> 1024 ret = func(*args, **kwargs)
1025 return _convert(ret, cls)
1026

TypeError: new_ones() missing 1 required positional arguments: "size"

Environment

PyTorch version: 1.8.0.dev20201025
Is debug build: True
CUDA used to build PyTorch: 11.0
ROCM used to build PyTorch: N/A

OS: Linux Mint 20 (x86_64)
GCC version: (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
Clang version: Could not collect
CMake version: version 3.16.3

Python version: 3.7 (64-bit runtime)
Is CUDA available: True
CUDA runtime version: Could not collect
GPU models and configuration: GPU 0: GeForce RTX 3090
Nvidia driver version: 455.23.04
cuDNN version: Could not collect
HIP runtime version: N/A
MIOpen runtime version: N/A

Versions of relevant libraries:
[pip3] numpy==1.19.1
[pip3] torch==1.8.0.dev20201025
[pip3] torchvision==0.8.0.dev20201025
[conda] blas 1.0 mkl conda-forge
[conda] cudatoolkit 11.0.221 h6bb024c_0
[conda] mkl 2020.2 256
[conda] mkl-service 2.3.0 py37he904b0f_0
[conda] mkl_fft 1.2.0 py37h23d657b_0
[conda] mkl_random 1.1.1 py37h0573a6f_0
[conda] numpy 1.19.1 py37hbc911f0_0
[conda] numpy-base 1.19.1 py37hfa32c7d_0
[conda] pytorch 1.8.0.dev20201025 py3.7_cuda11.0.221_cudnn8.0.3_0 pytorch-nightly
[conda] torchvision 0.8.0.dev20201025 py37_cu110 pytorch-nightly

cc @hameerabbasi @rgommers

Issue 2:
🐛 Bug

Pickling and then unpickling a subclass of Tensor should result in an object of the same class as what was pickled. However, it doesn't - instead it always creates something of class Tensor.

To Reproduce

The following prints torch.Tensor, however it should print _T.

class _T(torch.Tensor): ...
t = tensor([1]).as_subclass(_T)
print(type(pickle.loads(pickle.dumps(t))))

Expected behavior

It should print _T.

Environment

torch.__version__ == 1.7.0, running on Ubuntu.

Additional context

Placing the following method in the base class resolves the problem:

def __reduce_ex__(self,proto):
torch.utils.hooks.warn_if_has_hooks(self)
args = (type(self), self.storage(), self.storage_offset(), tuple(self.size()), self.stride())
if self.is_quantized: args = args + (self.q_scale(), self.q_zero_point())
f = _fa_rebuild_qtensor if self.is_quantized else _fa_rebuild_tensor
return (f, args + (self.requires_grad, OrderedDict()))

Perhaps something like this could be used to fix this issue.

cc @hameerabbasi @rgommers @mruberry
Issue 1:
OpenCV => 3.4.0

Operating System / Platform => Windows 64 Bit

Compiler => Visual Studio 2015

Graphic card =>Nvidia RTX 2080

CUDA =>10.1

hello everyone.

when I execute the cuda template match fuction , something wrong happens.

here is my test code from another issue here:

#include "cuda_runtime.h"
#include "opencv2/opencv.hpp"
#include <stdio.h>

int main()
{
cv::cuda::GpuMat image_h(1080, 1920, CV_8UC1);
cv::cuda::GpuMat templ_h(64, 64, CV_8UC1);
cv::cuda::GpuMat result(1080 - 64 + 1, 1920 - 64 + 1, CV_32FC1);

cv::Ptr<cv::cuda::TemplateMatching> alg;
printf("before create\n");
alg = cv::cuda::createTemplateMatching(templ_h.type(), CV_TM_CCOEFF_NORMED);
printf("before match\n");
alg->match(image_h, templ_h, result);
printf("finished\n");
cudaDeviceSynchronize();
return 0;
}

when it executes the alg->match() fuction, the procedure doesn't go further,as belows:

this fuction works well when I using Nvidia GTX 1070 and the cuda version is 9.1. I don't know why update to RTX 2080 and cuda version updates to 10.1,this function doesn't work. I haven't test other cuda functions .I recompile the opencv ,but it still doesn't work.

so I want to know how to solve this problem.I am new to opencv and cuda.some issues has seem to explain something about that.However I still don't know how to solve it.So someone can give me some direct methods .thank you very much.

Issue 2:
System information (version)

- OpenCV => 3.3.1, 3.4.4, 4.0.0
- Operating System / Platform => Jetson Xavier (Ubuntu 18.04, CUDA 10)
- Compiler => g++ 7.3.0

Detailed description

"cuda::createTemplateMatching" not work with CUDA10.0.

Although compiling the program works well, if you execute it,

the process stops while the process is activated.

cv::Ptr<cv::cuda::TemplateMatching> alg;
alg = cv::cuda::createTemplateMatching(templ_h.type(), CV_TM_CCOEFF_NORMED);
alg->match(image_h, templ_h, result);
Issue 1:
What problem does this feature solve?

Currently, adding one of Map, Set, WeakMap, WeakSet as a data attribute of a Vue component will mean there. Vue should do the same as it does with Array and patch methods like add() and remove()

Adding this feature solves the problem of for example being able to store unique lists of anything (Sets) or maps with structures as keys (since object keys always behave as strings).

The expected behaviour is that when add() does not actually modify a set, nothing would be triggered.

It's possible there is no good use for WeakMap, WeakSet. In that case there's no need to add these too.

What does the proposed API look like?

There's no change in the API from a user perspective. There would need to be documentation that Vue does basically the

Issue 2:
What problem does this feature solve?

If a key is not supplied in v-for, there will be a warning linking to the docs (which is helpful). However if Vue really just needs a unique ID so it can keep track of the elements, and the developer doesn't need a key, then Vue should just create it's own key to use rather than warning the developer.

Often items I have in a v-for don't really have any unique identifiers that would be good to use for a key, so I'm left with doing janky things to create a unique key, which seems brittle since unique identifier generation is a non-trivial problem. Someone proposed using something like https://github.com/ericelliott/cuid to do it, but I though, why not just have Vue do it for me under the hood?

What does the proposed API look like?

Current API:

<div v-for="item in items" :key="item.id">
<!-- content -->
</div>

Current API which results in a warning:

<div v-for="item in items">
<!-- content -->
</div>

Proposed API which will not result in a warning:

<div v-for="item in items">
<!-- content -->
</div>
Issue 1:
Hello,

I have trouble in comparing dtype of np.int32 array.

The power of np.int32 ndarray has dtype of np.int32 which seems different from proper np.int32.

Example:

Jupyter QtConsole 4.3.1
Python 3.6.3 |Anaconda custom (64-bit)| (default, Nov 8 2017, 15:10:56) [MSC v.1900 64 bit (AMD64)]
Type 'copyright', 'credits' or 'license' for more information
IPython 6.1.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import numpy as np
In [2]: np.__version__
Out[2]: '1.13.3'

In [3]: arr1 = np.arange(10)
In [4]: arr2 = np.arange(10)**2
In [5]: arr1.dtype.type
Out[5]: numpy.int32

In [6]: arr2.dtype.type
Out[6]: numpy.int32

In [7]: arr1.dtype.type == arr2.dtype.type
Out[7]: False

In [8]: arr1.dtype.type is arr2.dtype.type
Out[8]: False

In [9]: arr2.dtype.type == np.int32
Out[9]: False

I am using Anaconda version of numpy 1.13.3 with Python 3.6.3 on 64 bit Windows 7.

Issue 2:
On windows 7:

>>> np.cint, np.cint is np.int32
(numpy.int32, False)
>>> np.int_, np.int_ is np.int32
(numpy.int32, True)

On 64-bit linux:

>>> np.int_, np.int_ is np.int64
(numpy.int64, True)
>>> np.longlong, np.longlong is np.int64
(numpy.int64, False)

(original title: intc displays wrong class name)

The string representation of numpy.intc is <class 'numpy.int32'>. This would fine if this were true--just a name pointing to the same object. But at least on Windows 7, numpy.intc is not the same object as numpy.int32; it's not even a subclass. This is very confusing for debugging objects of this type, as objects inexplicably fail an isinstance test.

Could one of these two small changes be made:

Either make intc just be another name pointing to the object behind int32

Or make intc print out <class 'numpy.intc'>
Issue 1:
Summary

Snackbar inside a popover renders inside the popover

I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

Snackbar appears in the right position, positioned fixed to the viewport.

Steps to Reproduce (for bugs)

https://codesandbox.io/s/74v45jxyo0

Tech
Version

Material-UI
v1.0.0-beta.18

React
v16

browser
Latest Chrome

etc

Issue 2:
I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

The tooltip with a title of "Test Title" to be shown without line breaks:

Current Behavior

The tooltip adds a line break for every space in the title:

At first I thought it was a length issue, but it doesn't break when there's no spaces:

Steps to Reproduce (for bugs)

https://codesandbox.io/s/2wnv5jw2xj

Container should have position: 'absolute'

Add an IconButton surrounded by a Tooltip

Set Tooltip's title to Test Title

Context

I'm making a floating menu with absolute positioning, that moves around the screen to line up with an active component.

Your Environment

Tech
Version

Material-UI
^1.0.0-beta.22

React
^15.5.4

browser
Chromium Version 63.0.3239.84 (Official Build) Built on Ubuntu , running on Ubuntu 16.04 (64-bit)
Issue 1:
I'm trying to use form with $clearMissing = false but form never returns true to isValid().

This because on line https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Form/Form.php#L541 we submit child when the values passed are to the form or when $clearMissing == true.

This way every child fails in the validation stage here: https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Form/Form.php#L705 so the main form is never valid.

Issue 2:
While trying out the new form PATCH feature, I ran into a bug:

Say for instance you have a form with two children: firstName, lastName,

and you PATCH with this data: array('firstName' => 'Hank')

now the "submit" method is never called on the child "lastName". Now there's a problem, because Form::isValid() only returns true if $this->submitted is true. However, this is false for the "lastName" child. A form with children, in turn, will only return true, if all of it's children are true, which, now, is not the case.
Issue 1:
Now that the Default trait has been added for handling {} format, there are two ways to define how to convert an object to a string: foo.to_str() and format!("{}", foo); that is, the object needs to implement both ToStr and Default.

The proposal is to eliminate this duplication by eliminating ToStr and, instead, implementing to_str() by internally invoking the formatting function. This of course would be a major breaking change to existing code.

An alternative would be to provide a "default implementation" for the Default trait for anything implementing ToStr. This would be a backward-compatible change but would require extending the type system to allow for allowing default implementation of traits (if the type implements some other traits) with the ability to override the implementation for specific types.

Issue 2:
When developing inside of libstd, it's a lot more convenient to be able to make check-stage0-std instead of make check-stage2-std. But every now and again, we lose the ability to do that to some obscure linker error which can languish for a long time because the test suite doesn't make sure that it works.

Currently it is broken due to this:

error: duplicate entry for `str_eq`
error: aborting due to previous error
Issue 1:
In my example app / root component is rendered into document.body it also set's up onKeyDown onKeyUp to handle application keyboard shortcuts.

The problem I'm running into is that some user interaction like clicking around page causes document.body to obtain focus (to become document.activeElement) and in that case onKeyDown & onKeyUp event handlers are no longer invoked.

I know I could register "keydown", "keyup" event handlers manually once app component is mounted but I would prefer to stay with-in react.

Issue 2:
#284 reminded me that one thing I've sometimes wanted is to install a handler on window for keypress (for keyboard shortcuts) or scroll. Right now I can just do window.addEventListener in componentDidMount but since React is listening already, it would be nice if there were some way for me to intercept those events. (In addition, receiving normalized synthetic events is generally more useful.)
Issue 1:
I use command line tools but I have shortcut to them but they open in the cmd not WT(Windows Terminal)

Can I make a shortcut that opens the .exe in WT?

Issue 2:
Summary of the new feature/enhancement

Simply let the window to be moved around anywhere on the title bar, right now it is a very small section between the menu drop down and the system menu. This is purely a QOL issue, but it is one I noticed within 1 minute of starting the console.

Regardless, great work. Thanks

Proposed technical implementation details (optional)
Issue 1:
When dealing with discrete stochastic units, one often wants to define custom gradients. It seems like the most legitimate way to it in Tensorflow is to use grad_func keyword argument of function.Defun from tensorflow.python.framework. However, the gradient function is only given the inputs of the function defined and the gradients, whereas it would be often very convenient to also use the outputs.

For example, see the code below.

# In current Tensorflow I have to do like this:

@function.Defun(*(3 * [tf.float32]))
def oneovertwo_unit_bprop(probs, noise, grads):
outcome = tf.to_float(tf.less(noise, probs))
outcome_probs = outcome * probs + (1 - outcome) * (1 - probs)
return grads / 2. / outcome_probs, tf.zeros_like(noise)

@function.Defun(*(2 * [tf.float32]), grad_func=oneovertwo_unit_bprop)
def oneovertwo_unit_fprop(probs, noise):
return tf.to_float(tf.less(noise, probs))

def oneovertwo_unit(probs):
return oneovertwo_unit_fprop(probs, tf.random_uniform(tf.shape(probs)))

# I would like to do like this

def oneovertwo_unit_bprop(probs, outcome, grads):
outcome_probs = outcome * probs + (1 - outcome) * (1 - probs)
return grads / 2. / outcome_probs

@function.Defun(*(2 * [tf.float32]), grad_func=oneovertwo_unit_bprop)
def oneovertwo_unit(probs):
return tf.to_float(tf.less(tf.random_uniform(probs.get_shape()), probs))

FYI, this an implementation of the gradient estimator from the DARN paper (https://arxiv.org/pdf/1310.8499v2.pdf).

Issue 2:
System information

Have I written custom code (as opposed to using a stock example script provided in TensorFlow): Yes

OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux 16.04

TensorFlow installed from (source or binary): source

TensorFlow version (use command below): 1.8.0

Python version: 3.6

Bazel version (if compiling from source): 0.11

GCC/Compiler version (if compiling from source): gcc 5.4.0

CUDA/cuDNN version: 9.0 - 7.1

GPU model and memory: Titan X

Exact command to reproduce: N/A

We are trying to use distribute.MirroredStrategy to train a model on multiple GPUs on a single machine. We have a working implementation without warm start (training from scratch) and now want to initialise to model using checkpoint from imagenet before the training.

Our first attempt is to add init_from_checkpoint in our model function:

def model_fn(features, labels, mode, params):

.....

tf.train.init_from_checkpoint(params['resnet_checkpoint'], {'/': 'resnet50/'})

....

But, this gives us the following error

.../tensorflow/contrib/distribute/python/values.py", line 285, in _get_update_device
"Use DistributionStrategy.update() to modify a MirroredVariable.")

Is there an example of how to warm start a training with an existing checkpoint ?
Issue 1:
Describe the bug

Testing on various mobile devices (phones and pads) indicates that depending on the drivers, GPU:s and browser versions three.js may render all objects pitch-black. Mobile device having the same GPU/processor may behave differently depending on the phone model and year; older may work while newer doesn't. The same device may operate correctly with Chrome but not with Firefox etc.

To Reproduce

Since this is due to false positive value given by three.js checking on device capabilites, there is no easy way to reproduce it without the correct hw/sw combination. Using the simple test below, it can be reproduced on all devices that have this issue.

Live example

This will show a white cube on all devices:

var material = newTHREE.MeshPhongMaterial( { precision: 'mediump' } );

https://jsfiddle.net/f2Lommf5/6721/embedded/result

This will not show a white cube on some devices, rendering it pitch-black on some phones/pads:

var material = new THREE.MeshPhongMaterial( { precision: 'highp' } );

https://jsfiddle.net/f2Lommf5/6722/embedded/result

Possible solution

One solution to this would be using material precision: mediump on all mobile devices as a default value. This has first been suggested in 2018 by @Mugen87 #14570. There has been some arguments against this as a solution, and therefore perhaps a better solution to this would be some kind of automatic pre-testing whether the device really supports highp in practise or not, e.g. rendering a white test material sample and if it fails then defaulting material precision to mediump.

Platforms (tested, but there can be more):

Device: [Mobile]

OS: [Android]

Browser: [Chrome, Firefox]

Three.js version: r126 (min-126)

Issue 2:
Description of the problem

Right now, the default precision for shader progams in three.js is highp. Issues like #14137 showed that this approach causes rendering problems especially on (older) mobile devices . Using mediump would solve these issues and also improve the performance of the shader execution on mobile, see #14137 (comment).

The problem is that certain materials like MeshStandardMaterial can not produce correct visual output with mediump right now, see #14137 (comment). Changing certain parts of the shader souce code is necessary to solve this issue.

Three.js version

Dev

r94

...

Browser

All of them

Chrome

Firefox

Internet Explorer

OS

All of them

Windows

macOS

Linux

Android

iOS

Hardware Requirements (graphics card, VR Device, ...)
Issue 1:
I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

I'm using a custom Express server around my Next.js application and I would like to be able to deal with unhandled routes myself.

Current Behavior

Currently Next.js handles all routes and renders a 404 page when a matching route isn't found. I haven't found a way to circumvent this behavior other than by avoiding the nextApp.render() altogether, but that requires me to deal with /_next/ routes and hot reloading myself. I consider defineRoutes() to not be part of Next's public API so I don't want to use it.

Context

I'm implementing a new frontend for a legacy application. I want to migrate away from the old application page-by-page. I do this by having Express proxy any unhandled requests (as the final catch-all route) to the legacy environment. At the moment this is impossible due to Next.js handling 404s, so I have to resort to using a whitelist of "already implemented routes".

Proposal

I propose adding a finalizeRequests (default true) option to next({...options}) which allows us to disable the handling of unknown routes. Specifically this concerns these lines of code.

Issue 2:
I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

If a component defined at pages/_error.js returns props from its getInitialProps on the server side, those props should be passed in when rendering the error component.

Current Behavior

The server-generated props get thrown out when client/index.js’s render method checks for an err and calls renderError passing just props.err and not props.props.

Steps to Reproduce (for bugs)

Use NODE_ENV=production to avoid the dev-only error behavior

Make an _error component that returns values from getInitialProps that depend upon values known on the server.

Throw an exception from another page’s getInitialProps method

When you visit that page, your _error component will be rendered, but its props will be from the client-side getInitialProps call from the client’s renderError function.

Contributing

I’m happy to open a PR; I think that the fix would be to pass an optional set of props to renderError when render calls it in client/index.js. Only if those props are not provided would renderError call loadGetInitialProps.

If that’s a proper solution I can code it up.

Context

I initialize a bit of my app’s state (API keys and the like) by passing values on the req object that’s given on the server to getInitialProps. If the first page a visitor sees is an error page, then these values from the server are thrown away, leaving my app partially un-initialized.

Your Environment

Using Next 4.1.3 in my app, but looking through the code indicates that this is broken on HEAD as well.
Issue 1:
Code Sample, a copy-pastable example if possible

pd.DataFrame([['0.14145001', '59.47703987'],['0.14150000', '1.13963569']])

.. ... ...
0 1
0 0.14145001 59.47703987
1 0.14150000 1.13963569
[2 rows x 2 columns]

So far so good.

pd.DataFrame([['0.14145001', '59.47703987'],['0.14150000', '1.13963569'],['a','b']])

.. ... ...
0 1
0 0.14145001 59.47703987
1 0.14150000 1.13963569
1 0.14150000 1.13963569
2 a b
[3 rows x 2 columns]

Row 1 is displayed twice! It gets worse if you add more lists.

Problem description

When I put in 3 lists, I expect to see 3 lists.

Expected Output

.. ... ...
0 1
0 0.14145001 59.47703987
1 0.14150000 1.13963569
2 a b

Output of pd.show_versions()

# Paste the output here pd.show_versions() here
INSTALLED VERSIONS
------------------
commit: None
python: 3.6.1.final.0
python-bits: 64
OS: Darwin
OS-release: 15.6.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: en_US.UTF-8
LANG: en_US.UTF-8
LOCALE: en_US.UTF-8

pandas: 0.20.2

pytest: None

pip: 9.0.1

setuptools: 36.0.1

Cython: None

numpy: 1.13.0

scipy: None

xarray: None

IPython: 6.1.0

sphinx: None

patsy: None

dateutil: 2.6.0

pytz: 2017.2

blosc: None

bottleneck: None

tables: None

numexpr: None

feather: None

matplotlib: None

openpyxl: None

xlrd: None

xlwt: None

xlsxwriter: None

lxml: None

bs4: None

html5lib: None

sqlalchemy: None

pymysql: None

psycopg2: None

jinja2: 2.9.6

s3fs: None

pandas_gbq: None

pandas_datareader: None

Issue 2:
There is mean, max, median, min and mad yet no mode for groupby objects. Is there a good reason? What if I add and issue pull-request?
Issue 1:
following code

console.log("a", "b", "c");

shows a b c both in the browser and in node but in the log output of electron this is

[18220:0504/133340:INFO:CONSOLE(4)] "a", source: /Users/username/dev/test/app/preload.js (4)

Using "electron-prebuilt": "0.25.2"

Issue 2:
Expected behavior, to be able to call something like:

console.log(arg1, arg2, arg3) and see the output in stdout separated by commas.

Actual behavior is that only the first argument is output.