WhereIsAI/github-issue-similarity huggingface dataset:
Issue 1:
🐛 Bug

Using a numpy array i as index for a torch tensor t (i.e. t[i]) is interpreted differently than indexing a numpy array with the same index, or indexing t with the index converted to a tensor.

To Reproduce

import torch
import numpy as np

a=np.array([0.])
t=torch.tensor([0.])
i=np.array([[0,0],[0,0]])
a[i] # Fine
t[torch.tensor(i)] # Fine
t[i] # IndexError: too many indices for tensor of dimension 1

Expected behavior

I expected the last line to behave the same as the previous two.

Environment

PyTorch version: 1.4.0

Is debug build: No

CUDA used to build PyTorch: 10.1

OS: Debian GNU/Linux bullseye/sid

GCC version: (Debian 9.2.1-30) 9.2.1 20200224

CMake version: version 3.16.3

Python version: 3.7

Is CUDA available: Yes

CUDA runtime version: 10.1.168

GPU models and configuration: GPU 0: Quadro M2000M

Nvidia driver version: 440.64

cuDNN version: /usr/lib/x86_64-linux-gnu/libcudnn.so.7.6.5

Versions of relevant libraries:

[pip3] numpy==1.17.4

[pip3] numpydoc==0.7.0

[pip3] torch==1.4.0

[pip3] torchvision==0.5.0

[conda] Could not collect

Additional context

This appears related to #22013 and #29522 (possibly #18616). If a numpy array is treated as an arbitrary Iterable, it is probably a duplicate of one of those, although there is the possibility of handling array-like types differently. I am reporting this because I am not sure the issue is exactly the same, but please don't hesitate to close this issue if it is redundant.

Issue 2:
📚 Documentation

The docs for index_put_ state in the second paragraph:

If accumulate is True, the elements in tensor are added to self. If accumulate is False, the behavior is undefined if indices contain duplicate elements.

It should be corrected to elements in _value_ are added to self.
Issue 1:
Microsoft Windows [Version 10.0.18363.418]

(c) 2019 Microsoft Corporation. All rights reserved.

C:\Users\byr>npm install -g expo-cli

npm WARN deprecated request@2.88.2: request has been deprecated, see request/request#3142

npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:

npm ERR! https://npm.community

npm ERR! A complete log of this run can be found in:

npm ERR! C:\Users\byr\AppData\Roaming\npm-cache_logs\2020-03-12T08_35_11_476Z-debug.log

C:\Users\byr>

help me

Issue 2:
Is there an existing issue for this?

I have searched the existing issues

This issue exists in the latest npm version

I am using the latest npm

Current Behavior

Hello,

I want to execute preinstall script BEFORE the dependencies of my project describes in package.json are downloads, but it doesn't occurs in:$ npm --version8.5.3

Thanks in advance

Expected Behavior

Execution the preinstall script BEFORE any action of the install script

Steps To Reproduce

npm install

The preinstall script defined in package JSON executes AFTER the dependencies are downloaded, NOT BEFORE.

Environment

npm:

Node.js:

OS Name:

System Model Name:

npm config:

; copy and paste output from `npm config ls` here
Issue 1:
Problem statement

When extending your desktop to multiple monitors, Windows 10 allows you to position and align the monitors, but on a pixel by pixel alignment. When using multiple monitors of different sizes and resolutions, it is difficult to drag your mouse from one monitor to the next when the sizes are different. Where the monitors don't align, your mouse cursor hits an invisible wall. Your eyes go to the next monitor looking for the cursor, but it's trapped on the previous monitor, right on the edge where your eyes don't see it. To find your mouse, your frantically wiggle your mouse around to find it, eventually dislodging it from the invisible wall, but sometimes sending it to a screen you don't expect.

Proposed feature

Always let the mouse go from one screen to the next. Never hit an invisible wall between screens.

Technical suggestions

You could either align the edges by percentage or specify an action when the "invisible wall" is hit.

Option A - If the mouse leaves monitor 1 at 5% of the total height, have it enter the adjacent monitor 2 at the same 5% height.

Option B - If the mouse leaves monitor 1 at 5% of the total height, and this does not align with Monitor 2, provide a rule for how this is handled. This could be things like "always at the top," "middle of monitor," or "bottom of monitor."

Option C - If you want to prove your coding skills and make a real power toy, let every edge of a monitor be assignable to connect to any other screen or screens. Sometimes the second monitor is both up and to the right. Some people expect to use the right edge while other use the top edge. Let us assign both edges to the second monitor. Or even better yet, let us position and size it however we like, such as the top right edge and the right edge. Use the percentage method to make it happen.

Issue 2:
Environment

Windows build number: Microsoft Windows [Version 10.0.18362.836]
PowerToys version: PowerToysSetup-0.18.1-x64
PowerToy module for which you are reporting the bug (if applicable): PowerToys Run

Steps to reproduce

Install 0.18.1-x64 version

Expected behavior

Alt+Space triggering the search bar

Actual behavior

After installation of the new version, the shortcut of Alt+Space stopped working. It doesn't open the search bar.

Things that I tried

Reboot the system. It didn't work

Reinstall the program. It didn't work

I remove the 0.18.1 and downgrade to 0.18.0 and the PowerToys Run is working.
Issue 1:
Tuomas Kiviaho opened SPR-6107 and commented

In order to define bean using factory method from other than bean class itself requires currently using of a registered factory bean. Registered factory bean feels quite useless when implementing factory method pattern. In worst case bean count duplicates if bean name of factory bean has to be generated on the fly.

MethodInvokingFactoryBean (with help of MethodInvoker) allows static class as prefix of factory method name and can therefore be used as registered factory bean but incorporating of this logic directly to org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryMethod (and possibly to some other places than I've overlooked) would omit the need of factory bean altogether in these cases. Using MethodInvoker might also be beneficial since it already contains logic to handle illegal state scenarios which would be possible with this addition.

Affects: 2.5.6

Issue 2:
Ben Rowlands opened SPR-5125 and commented

The Spring DAO exception hierarchy is not fine grained enough to isolate duplicate key errors. A duplicate key error is an example of where an application may catch the exception and invoke alternative logic instead of just letting it fall down the stack.

For example, we read messages from a queue and insert the data into a database. We explicitly catch a duplicate key insert exception as this indicates we've processed the same message earlier. This is more efficient than a guarding the update with a check-then-act (which also introduces a race condition that may lead to dup-key exception anyway).

Additionally, if we use single-phase commit for our JMS and DB transactions (commit DB first then JMS) a failure scenario is that the DB transaction commits but the JMS transaction rollsback. In this case the message is delivered again and we get a dup-key exception. We can then safely ignore such duplicate messages.

A dup-key error is currently classified as a DataIntegrityViolationException along with other errors such as a data bounds error so we can't simply catch this exception type. We could work around this be checking the vendor error-code/state however this is not portable and cumbersome.

Ideally an exception like:

public class DuplicateKeyException extends DataIntegrityViolationException { }

Spring already provides mappings from vendor specific codes so it would be very powerful if it could provide a fine grained exception to allow this common duplicate-key handling pattern to be detected just using exception type.

We currently use the following SQLExceptions to detect a dup-key:

Sybase: error-state=23000

DB2: error-state=23505

Issue Links:

SPRNET-1215 Add DuplicateKeyException to DAO exception hierachy ("is depended on by")

SPRNET-1216 Change exception translation mappings to throw DuplicateKeyException ("is depended on by")

#9799 Add DuplicateKeyException to DAO exception hierachy ("is duplicated by")

#7663 Subclass DataIntegrityViolationException to represent main constraint types and translate SQL exceptons into appropriate subclass

Referenced from: commits a0139ab

1 votes, 2 watchers
Issue 1:
I've tried to train intermediate layers independently but when I run my code I've got out of memory issue.

I would like to know retain_graph = True is the problem? or not and what I have to do to solve this problem.

I am using hugging face BERT model and this is my code

Thank you.

t_outputs = t_model(**intputs)
s_outputs = s_model(**inputs)
encoder_layers = args.encoder_layers

loss = torch.nn.KLDivLoss(reduction='batchmean')
batch, row, col = s_outputs[3][1].size()

for i, k in enumerate(encoder_layers):
output = loss(F.log_softmax(s_outputs[3][i+1], dim=2).view(batch*row, 1, col), F.softmax(t_result[3][k+1],dim=2).view(batch*row, 1, col))
# to freeze layers
for name, p in s_model.named_parameters():
if "layer." + str(i-1) in name:
p.requires_grad = False
output.backward(retain_graph=True)

cc @albanD @mruberry

Issue 2:
Ok, sorry to bother you again, and really sorry if I am just doing it wrong again (I looked at the docs for things that would address this, but didn't see anything after looking at it quickly).

It appears that the next segment of code leaks CUDA memory. I don't believe I had this problem on 0.2.0 (or some version close to that) on the code that I was running (that I prefer to not publicly disclose, which is why I came up with this example instead):

net = torch.nn.Linear(30000,1).cuda()
data = torch.ones(100, 30000).cuda()
for rep in range(1000):
for batchIndices in range(0,100,100):
batch = torch.autograd.Variable(data[batchIndices:batchIndices+10], requires_grad=True)
net.forward(batch).norm(2).backward(create_graph=True)
batch.grad.norm(2).backward()

nvidia-smi output:

After first run of this:

| 0 TITAN X (Pascal) Off | 00000000:02:00.0 Off | N/A |
| 33% 55C P8 14W / 250W | 2417MiB / 12189MiB | 0% Default |

After second run of this (but without the lines defining net and data):

| 0 TITAN X (Pascal) Off | 00000000:02:00.0 Off | N/A |
| 32% 51C P2 58W / 250W | 4417MiB / 12189MiB | 0% Default |

This seems like a similar issue to #3824. The code in that issue's first post that reproduces it is similar to mine, so I suspect I am doing it correctly (just to defend myself!).

torch.__version__ is '0.3.0.post4'

I downgraded pytorch to 0.2.0 to make sure it didn't happen, and it appears not to; torch.__version__ says '0.2.0_0'.

Sorry if you are working on this already; I hope that some more feedback wouldn't be too annoying, at least.

cc @ezyang @ssnl @albanD @zou3519 @gqchen @ngimel
Issue 1:
TypeScript Version:

1.8

Code

I have following tsconfig.json file in my project root directory (e.g. P:\MyProjectRoot\tsconfig.json):

{
"compileOnSave": true,
"compilerOptions": {
"preserveConstEnums": true,
"experimentalDecorators": true,
"declaration": false,
"emitBOM": true,
"sourceMap": true,
"outFile": "Scripts/site/Serene.Web.js"
}
}

I have my .ts files under some sub folders of ~/Scripts and ~/Modules directories.

I'm running TypeScript compiler with the following command line:

P:\MyProjectRoot>"c:\Program Files (x86)\Microsoft SDKs\TypeScript\1.8\tsc"

Expected behavior:

I expect it to generate a output at P:\MyProjectRoot\scripts\site\Serene.Web.js

Actual behavior:

tsc just exists without generating a file or giving any error.

If i run same command line under P:\MyProjectRoot\scripts:

P:\MyProjectRoot\scripts>"c:\Program Files (x86)\Microsoft SDKs\TypeScript\1.8\tsc"

It generates the expected output.

As a side note, tsc is not in path, not sure if it has any effects.

Also this root folder has a .csproj file with TypeScript configured. I tried to delete all files except tsconfig.json in root directory, but it had no effect.

There is no other tsconfig.json file in subdirectories or parent folders.

Issue 2:
From the kangax compatibility table (related test):

14 Note that prior to ES6, it was recommended that ES5 implementations forbid block-level declarations in strict mode.

In ES6, block-level function declarations have block scoping in strict mode. Currently the following is a compiler error in TypeScript:

"use strict";
function f() { // error TS2393: Duplicate function implementation.
return 1;
}

{
function f() { // error TS2393: Duplicate function implementation.
return 2;
}
console.log(f() === 2);
}

console.log(f() === 1);

We should consider the following changes:

Allow the above in ES6 when in strict mode, with the function declaration f being block-scoped with respect to name resolution.

For ES5 strict-mode, allow the above with the following emit:

"use strict";
function f() {
return 1;
}

{
function f_1() {
return 2;
}
console.log(f_1() === 2);
}

console.log(f() === 1);
Issue 1:
pi@raspberrypi ~ $ go version
go version devel +c61a75775ab6 Fri Mar 22 17:46:45 2013 -0400 linux/arm
pi@raspberrypi ~ $ cd $ov/go-client/hellovg
pi@raspberrypi ~/gowork/src/github.com/ajstarks/openvg/go-client/hellovg $ ./hellovg
fatal error: malloc/free - deadlock
[signal 0xb code=0x1 addr=0x2f0 pc=0x2cc04]

goroutine 1 [syscall]:
[fp=0xb689ff1c] return()
/home/pi/go/src/pkg/runtime/asm_arm.s:275
[fp=0xb689ff44] runtime.cgocall(0x33a54, 0xb576c)
/home/pi/go/src/pkg/runtime/cgocall.c:149 +0xd8
[fp=0xb689ff6c] runtime.cgocall(0xb6f5f5f5, 0xff0000)
/home/pi/go/src/pkg/runtime/cgocall.c:149 +0xd8

goroutine 2 [syscall]:

Note that all tests passed for the build.

This is my standard test when I pull a new release on my raspi-- rebuild everything,
rebuild the cgo-based openvg library, rebuild all clients.

What do you see instead?

Crash

Which compiler are you using (5g, 6g, 8g, gccgo)?

5g, cgo

Which operating system are you using?

Linux raspberrypi 3.6.11+ #385 PREEMPT Fri Mar 1 21:53:22 GMT 2013 armv6l GNU/Linux

Which version are you using? (run 'go version')

go version devel +c61a75775ab6 Fri Mar 22 17:46:45 2013 -0400 linux/arm

Please provide any additional information below.

The crashing program is linked with a cgo-created OpenVG library. See:
https://github.com/ajstarks/openvg/blob/master/openvg.go

Issue 2:
What does 'go version' print?
go version go1.3beta2 +5bf1a8b3aeea Thu May 29 13:47:31 2014 -0400 darwin/amd64

What steps reproduce the problem?
If possible, include a link to a program on play.golang.org.

1. run this code: http://play.golang.org/p/hxuIOC49ac

What happened?
A quarter to a half of the requests have errors such as:
- http: can't write HTTP request on broken connection
- Get http://www.adobe.com/nz/nz-sitemap.xml: EOF

What should have happened instead?
All get requests should succeed

Please provide any additional information below.
If you put a 1 second sleep between each request they all succeed

I looked for possibly related issues and this and found these that seem to be related:
https://golang.org/issue/4677
https://golang.org/issue/3514
Issue 1:
We propose to add a pod/dockercmd subresource, so that user can run some userful docker command on his container, such as commit the image of his container by running docker commit.

By now, k8s just support the docker logs and docker attachcommand by the pod/log and pod/attach subresource. Our idea is to add a general pod/dockercmd subresource to support more useful docker commands(and disable some dangerous commands such as docker stop), the existing pod/log and pod/attache subresource can be deprecated after the pod/dockercmd subresource is supported.

Such a way is much more extensible: if we want support another docker command in the future, just add it to the "whitelist", instead of adding a new subresource and duplicating a lot of code.

Any comment is welcomed.

Issue 2:
Passed on kubernetes-test-go 3-4 times, and then failed:

TestGC

gc_controller_test.go:122: [1]pod's deleted expected and actual did not match.
expected: [a]
actual: [b]

cc @brendandburns
Issue 1:
I'm using Chrome version 21 and Mac OS X 10.7.

I don't have this same problem on Firefox 14, Safari 6, or Opera 12.

Issue 2:
Tabs used as tabbable content areas for swapping out panes of content display no content each time the page is refreshed. I have to click on the second tab to display the content included in both tabs.

For info, in my tabs, there aint any js effect but bootstrap-tabs.js.
Issue 1:
The behaviour below occurs in versions '0.15.0rc1-21-g32c5016' and '0.14.1'.

When the label passed to the drop method of a Series is not in the index:

(a) if the index is not all booleans then an error is raised

(b) if the index is all booleans and has length > 1 then no error is raised; the original series is returned

(c) if the index is all booleans and has length == 1 then an error is raised

I propose that:

the difference between the behaviour in (a) and (b) should be documented

the behaviour in (c) should be changed to match that in (b)

Examples of current behaviour:

(a)

>>> pd.Series([1, 1], index=['a', True]).drop(False)
ValueError: labels [False] not contained in axis

(b)

>>> pd.Series([1, 1], index=[True, True]).drop(False)
True 1
True 1
dtype: int64

(c)

>>> pd.Series([1], index=[True]).drop(False)
ValueError: labels [False] not contained in axis

Issue 2:
Hello,

The following code ran perfectly fine on 0.14.1, but breaks on 0.15 RC1, raising

ValueError: cannot reindex from a duplicate axis.

Is it a bug or an intended change of behaviour? Thanks.

import pandas as pd
import numpy as np
d = {'Quantity' : pd.Series([1., 2., 3., 4., 5.],
index=['foo', 'foo', 'foo', 'foo', 'bar']),
'Group' : pd.Series([1, 2, 1, 2, 1], index=['foo', 'foo', 'foo', 'foo', 'bar'])}

df = pd.DataFrame(d)
groups = df.groupby([df.index, 'Group'], sort=False, as_index=True)

temp = groups['Quantity'].apply(lambda x: x+np.roll(x, 1))

df['QuantityApplied'] = temp

Pandas 0.15.0 RC1
Issue 1:
deno compile -A --unstable main.ts -o ngs-signer -L debug
Check file:///Users/synadia/Dropbox/code/src/github.com/aricart/nas-nats/ngs-signer/main.ts
Compile file:///Users/synadia/Dropbox/code/src/github.com/aricart/nas-nats/ngs-signer/main.ts
Emit ngs-signer
synadia@malaga ~/D/c/s/g/a/n/ngs-signer (main)> ./ngs-signer -c ngs-signer.conf
error: Module not found

Running with -L debug doesn't produce any useful messages.

Verified that executables fail both in OS X, and x86_64-unknown-linux-gnu.

If the above error is a true error (perhaps changes in the bundling in 1.19.0, a path/url to the missing module would be great) - all previous versions have been stable.

Issue 2:
Since v1.19.0 was released, we're seeing a problem when running deno compile in Github Actions.

See: https://github.com/ecadlabs/taqueria/runs/5234787765?check_suite_focus=true

We were using:

- name: Setup Deno
uses: denoland/setup-deno@v1
with:
deno-version: "^1.0.0"

When I hardcode the version to 1.18.2 everything works fine:

https://github.com/ecadlabs/taqueria/runs/5236615612?check_suite_focus=true
Issue 1:
I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

When using material-ui with Server Side Rendering -

There should be no validation issues shown by https://validator.w3.org

Current Behavior

There are many validation issues thrown by https://validator.w3.org when using Material-UI with server side rendering

Steps to Reproduce (for bugs)

Go to https://validator.w3.org

Enter https://material-ui.com/ in address Bar (since material-ui-next is exactly the use-case which is Server-Side-Rendering with Material-UI

There are many error generated, some of them quite easy to fix.

Enter URLs of other pages from components demo and there are some similar errors and some other errors as well

Context

I want to create an application which validates with W3C validator.

Your Environment

Tech
Version

Material-UI
1.0.0-beta.27

React
16.2.0

browser

etc

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

Expected Behavior

You should be able to use a [Switch] inside an [ExpansionPanel]

Current Behavior

When you include a [Switch] inside an [ExpansionPanel] every time you toggle the switch, the expansion panel collapses.

Steps to Reproduce (for bugs)

https://codesandbox.io/s/wwq1nq4w77

Insert Switch into ExpansionPanel

Use switch

Context

I need to switch between advanced content inside the panel.

Your Environment

Tech
Version

Material-UI
1.0.0-beta.22

React
16.0.0

browser
Safari Version 11.0.1 (13604.3.5)
Issue 1:
What problem does this feature solve?

similar to angularjs directives, would like the ability to alias the names the component's parent uses to pass values

What does the proposed API look like?

component:

export default {
name: "paging",
props: {
"count": {"name": "pagingCount", "type": Number}
},

parent:

<paging v-bind:paging-count="itemsCount"></paging>

Issue 2:
What problem does this feature solve?

Debugging from template code is frustratingly impractical because you lose access to the conventional tools available to you in plain javascript. The reference to the console is missing because it is not in the scope of the component instance. Yes, you can add it to the component instance or even the global Vue prototype, but to have to do this every time you need to debug, and then remove for the sake of keeping your code clean, is needlessly tedious.

Additionally, the debugger keyword (for example within an in-template IIFE) is barely of any use because the compiled variables do not match those of the component instance.

This has been an issue for me for a while now, but I was more forgiving of it because how incredible Vue otherwise is. However, I recently noticed that Svelte.js offers a pretty nifty OOTB feature for debugging in templates.

From their docs:

The {@debug ...} tag offers an alternative to console.log(...). It logs the values of specific variables whenever they change, and pauses code execution if you have devtools open.

It accepts a comma-separated list of variable names (not arbitrary expressions).

The {@debug} tag without any arguments will insert a debugger statement that gets triggered when any state changes, as opposed to the specified variables.

Is there any way we can bring this into Vue template syntax?

What does the proposed API look like?

<template>
<div>
{{ @debug }}
or
{{ @debug var1, var2, ..., varN }}
</div>
</template>