sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: pytorch
Issue: Allow forward method to be defined with .define() in new TorchScript API
Labels: oncall: jit,triaged,jit-backlog

## 🐛 Bug

Script modules support defining new methods from code with `.define()` call. With new API it's impossible to define `forward` method like this because jit scripting happens before the .define call.

## To Reproduce

This code fails:
```
class Foo(torch.nn.Module):
    def __init__(self):
        super(Foo, self).__init__()

m = Foo()
m = torch.jit.script(m)
m.define("""
def forward(self):
    return torch.rand(3)
""")
```

Error: `RuntimeError: No forward method was defined on Foo()`

Same happens if another method refers to a method being defined

```
class Foo(torch.nn.Module):
    def __init__(self):
        super(Foo, self).__init__()
    
    def forward(self):
        return self.bla()

m = Foo()
m = torch.jit.script(m)
m.define("""
def bla(self):
    return torch.rand(3)
""")
```

## Expected behavior

This behavior worked fine with the old API of ScriptModule:

```
class Foo(torch.jit.ScriptModule):
    def __init__(self):
        super(Foo, self).__init__()
        self.define("""
        def forward(self):
            return torch.rand(3)
        """)    

m = Foo()
```

Or with another method:

```
class Foo(torch.jit.ScriptModule):
    def __init__(self):
        super(Foo, self).__init__()
        self.define("""
        def bla(self):
            return torch.rand(3)
        """)    

    @torch.jit.script_method
    def forward(self):
        return self.bla()

m = Foo()
```

cc @suo
Repository: pytorch
Issue: Confusing error message for Custom Class type mismatch
Labels: oncall: jit,triaged,jit-backlog

## 🐛 Bug

When using user-defined classes, it's easy to miss type annotation of members of the class (and Python won't error out). The only error occurs when the instance of the class is passed to one of the torchscript functions and it's pretty confusing by itself.

## To Reproduce

```python
import torch
from torch import Tensor

@torch.jit.script
class Pair:
  def __init__(self, first, second):
    self.first = first
    self.second = second

@torch.jit.script
def sum_pair(p):
  # type: (Pair) -> Tensor
  return p.first + p.second

# works
p = Pair(torch.tensor([1]), torch.tensor([2]))
print(sum_pair(p))

# errors
p2 = Pair(1, 2)
print(sum_pair(p2))
```

Produces:
```
     17
     18 p2 = Pair(1, 2)
---> 19 print(sum_pair(p2))

RuntimeError: sum_pair() Expected a value of type '__torch__.Pair' for argument 'p' but instead found type 'Pair'.
Position: 0
Value: <__main__.Pair object at 0x7fb985f6f3c8>
Declaration: sum_pair(ClassType<Pair> p) -> (Tensor)
```

## Expected behavior

Better error message (ideally with individual fields names that mismatch) would be nice.



cc @suo
Repository: go
Issue: path/filepath: Glob fails if it has a wildcard and ends with /
Labels: NeedsInvestigation

<!-- Please answer these questions before submitting your issue. Thanks! -->

### What version of Go are you using (`go version`)?

<pre>
$ go version
go version go1.12 darwin/amd64
</pre>

### Does this issue reproduce with the latest release?

Yes

### What operating system and processor architecture are you using (`go env`)?

<details><summary><code>go env</code> Output</summary><br><pre>
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/black-hole/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/black-hole/.gvm/pkgsets/go1.12/global"
GOPROXY=""
GORACE=""
GOROOT="/Users/black-hole/.gvm/gos/go1.12"
GOTMPDIR=""
GOTOOLDIR="/Users/black-hole/.gvm/gos/go1.12/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/dev/null"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/82/jkr30dwj24ncf6ng3tdv9kd40000gn/T/go-build925523187=/tmp/go-build -gno-record-gcc-switches -fno-common"
</pre></details>

### What did you do?

<!--
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
-->

https://play.golang.org/p/hOALcoEmrWz

### What did you expect to see?

Accurate return path

### What did you see instead?

Cannot match when there is a wildcard in the path and the last character is /


### Other

![image](https://user-images.githubusercontent.com/8198408/62920066-2fdad680-bdd7-11e9-902b-808c85c1b01b.png)
Repository: pytorch
Issue: torch.utils.tensorboard.SummaryWriter fails to flush at program exit
Labels: triaged,module: tensorboard

```python
K = 10

import torch
import torch.utils.tensorboard

param = torch.randn(10, 10)
param_grad = torch.randn(10, 10)
norm, grad_norm = param.norm(), param_grad.norm()
ratio = grad_norm / (1e-9 + norm)

tensorboard = torch.utils.tensorboard.SummaryWriter('tb_bug')
for iteration in range(K):
    tensorboard.add_scalars('test', dict(norm = norm, grad_norm = grad_norm, ratio = ratio), iteration)
```
`tensorboard --logdir tb_bug` shows no data. When K = 100, TensorBoard shows the plot correctly

torch version is '1.2.0.dev20190804', tensorboard version is '1.14.0'

Full output of `tensorboard --logdir tb_bug --inspect`:
```
TensorFlow installation not found - running with reduced feature set.
======================================================================
Processing event files... (this can take a few minutes)
======================================================================

Found event files in:
tb_bug
tb_bug/test_norm
tb_bug/test_grad_norm
tb_bug/test_ratio

These tags are in tb_bug:
audio -
histograms -
images -
scalars -
tensor -
======================================================================

Event statistics for tb_bug:
audio -
graph -
histograms -
images -
scalars -
sessionlog:checkpoint -
sessionlog:start -
sessionlog:stop -
tensor -
======================================================================

These tags are in tb_bug/test_norm:
audio -
histograms -
images -
scalars -
tensor -
======================================================================

Event statistics for tb_bug/test_norm:
audio -
graph -
histograms -
images -
scalars -
sessionlog:checkpoint -
sessionlog:start -
sessionlog:stop -
tensor -
======================================================================

These tags are in tb_bug/test_grad_norm:
audio -
histograms -
images -
scalars -
tensor -
======================================================================

Event statistics for tb_bug/test_grad_norm:
audio -
graph -
histograms -
images -
scalars -
sessionlog:checkpoint -
sessionlog:start -
sessionlog:stop -
tensor -
======================================================================

These tags are in tb_bug/test_ratio:
audio -
histograms -
images -
scalars -
tensor -
======================================================================

Event statistics for tb_bug/test_ratio:
audio -
graph -
histograms -
images -
scalars -
sessionlog:checkpoint -
sessionlog:start -
sessionlog:stop -
tensor -
======================================================================
```
Repository: flutter
Issue: FlutterDriver: add ability to handle pesky system dialogs during automation
Labels: tool,d: api docs,t: flutter driver,c: proposal,P3,team-tool,triaged-tool

Example of dialog

![image](https://user-images.githubusercontent.com/82182/62925979-64d13400-bdab-11e9-843a-d1da9f630a77.png)

It remains over the top of the Flutter app being automated for the duration :-(

I've tried recreating the emulated device, and hard reboots, but this consistently comes up during FlutterDriver test suites. The tests nearly always pass* despite this dialog being up at the before the first one goes through it and intermittently through the suite of tests. There are videos and StackOverflow postings on how to twiddle Android settings to prevent it, but they are for older versions of Android, or not applicable to my Galaxy-flavored setup.  The build machine is a 2018 MacMini (Mojave, patched up to date, 8GB, plenty of SDD left).

**Could the Flutter dev team provide canonical advice as to how to handle system dialogs during FlutterDriver test-automation suites, please?**

Also - can we encourage FlutterDriver to be referred to as FlutterDriver and not just 'driver'. I'm co-creator of Selenium 1.0. Selenium 2+ was an implementation called WebDriver (by Simon Stewart or ThoughtWorks then Google). We ourselves don't call that 'driver' in conversation or documentation, could y'all encourage the same for increased clarity and google-ability, please?
Repository: pytorch
Issue: Tensorboard: Add disable flag for debugging
Labels: triaged,enhancement,module: tensorboard

## 🚀 Feature
For debugging it's a bit annoying to uncomment or have thousands of if / else statements when one does not want to log a run. 

A simple SummaryWriter(..., disabled=True) flag would be helpful :)
Repository: kubernetes
Issue: Compute and propagate EndpointsLastChangeTriggerTime for all cases
Labels: kind/bug,sig/scalability,lifecycle/frozen

This is important to implement [Networking programming latency SLI](https://github.com/kubernetes/community/blob/master/sig-scalability/slos/network_programming_latency.md). At the moment it's only changed when list of pods changes.

According to @wojtek-t this issue would be resolved, when server-side apply would be implemented and we timestamp all changes. At the moment it's hardly feasible to do it. 

Tracking issue, so we don't forget to remove temporary workarounds. 

/cc @mm4tt
Repository: TypeScript
Issue: null check of a const property incorrectly resolved
Labels: Needs Investigation

<!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. -->
**TypeScript Version:**  3.5.3 (also tried with `@next`)

<!-- Search terms you tried before logging this (so others can find this issue more easily) -->
**Search Terms:** const symbol property "not assignable to type"

**Code**

```ts
/*
 * For reasons of how the JSON is converted, I'm using Symbols to hide certain properties.
 */

class Server {
    public auth: string | null = null;
}

/** `tsc` complains about this[AUTH_PROP] even though it must always be a string inside the `if()` */
const AUTH_PROP = Symbol();
class TestSymbol {
  private readonly [AUTH_PROP]: string | null = null;
  public readonly server: Server | null = null;

  public get auth(): string | undefined {
    if (this[AUTH_PROP] !== null) {
      return this[AUTH_PROP];
    }
    if (this.server && this.server.auth) {
      return this.server.auth;
    }
    return undefined;
  }
}

/** same thing with a string literal and it works */
class TestNoSymbol {
    private readonly _auth: string | null = null;
    public readonly server: Server | null = null;

  public get auth(): string | undefined {
    if (this['_auth'] !== null) {
      return this['_auth'];
    }
    if (this.server && this.server.auth) {
      return this.server.auth;
    }
    return undefined;
  }
}

/** same thing with a const string and it fails */
const AUTH_PROP_S = '_auth';
class TestConstString {
    private readonly [AUTH_PROP_S]: string | null = null;
    public readonly server: Server | null = null;

  public get auth(): string | undefined {
    if (this[AUTH_PROP_S] !== null) {
      return this[AUTH_PROP_S];
    }
    if (this.server && this.server.auth) {
      return this.server.auth;
    }
    return undefined;
  }
}
```

**Expected behavior:**
All 3 versions of this should be fine, and not throw a `tsc` error.  The `const` values can never be changed so it must always be a `string` inside the `if()` statement.

**Actual behavior:**
```
Type 'string | null' is not assignable to type 'string | undefined'.
  Type 'null' is not assignable to type 'string | undefined'.
```

**Playground Link:** https://is.gd/V7Jai9

**Related Issues:** not sure
Repository: godot
Issue: Error spam Condition ' p_size < 0 ' is true. when setting internal_vertices in Polygon2D
Labels: bug,topic:core,confirmed

**Godot version:**
3.2.dev.custom_build. 3ea33c0e4

**Issue description:**

Error spam when move mouse at the 2d viewport with Polygon2D
```
ERROR: resize: Condition ' p_size < 0 ' is true. returned: ERR_INVALID_PARAMETER
   At: ./core/cowdata.h:252.
```
**Minimal reproduction project:**
[The-worst-Godot-test-project2.zip](https://github.com/godotengine/godot/files/3497772/The-worst-Godot-test-project2.zip)
Repository: TypeScript
Issue: Strange any with export interface and variable of same name
Labels: Bug,Domain: Quick Info

<!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. -->
**TypeScript Version:**
3.5.3.  Also reproduces on all Playground versions from 2.7.2 to 3.5.1.  Does not reproduce on 2.4.1

<!-- Search terms you tried before logging this (so others can find this issue more easily) -->
**Search Terms:**
interface export any duplicate

**Code**

```ts
export interface A {
}
const A = {
};
```

**Expected behavior:**
Quick info on `const A` shows type `{}`

**Actual behavior:**
Quick info on `const A` shows type `any`

If `export` is removed, the problem goes away.

**Playground Link:** <!-- A link to a TypeScript Playground "Share" link which demonstrates this behavior -->
[Playground](https://www.typescriptlang.org/play/#code/KYDwDg9gTgLgBASwHY2FAZgQwMbDgQTgG8AoAXxJOwiQGd5CBeY8gbhKA)

**Related Issues:**
https://github.com/microsoft/TypeScript/issues/31031
Repository: create-react-app
Issue: Allow jest `verbose` configuration option
Labels: issue: proposal,needs triage

### Is your proposal related to a problem?

<!--
  Provide a clear and concise description of what the problem is.
  For example, "I'm always frustrated when..."
-->

When executing tests that may output a number of log lines irrelevant to the test run it would be nice to hide those by using Jest's built in `verbose` option. 

### Describe the solution you'd like

<!--
  Provide a clear and concise description of what you want to happen.
-->

Add `verbose` to the whitelist for jest options in `createJestConfig.js`. After making this modification locally I haven't run into any negative side effects.

### Describe alternatives you've considered

<!--
  Let us know about other solutions you've tried or researched.
-->
- Providing a custom logging interface seemed a bit excessive when this functionality is built into the test tool but is gated by a whitelist.

- Removing the whitelist entirely and allow freeform Jest configuration. 

### Additional context

<!--
  Is there anything else you can add about the proposal?
  You might want to link to related issues here, if you haven't already.
-->

The suggestion to eject when trying to use a non-whitelisted jest configuration option seems a bit heavy handed vs a link to create an issue about adding a new option or an explanation as to why there is a whitelist.
Repository: pytorch
Issue: hasSideEffects INTERNAL ASSERT FAILED when using .split method with JIT
Labels: high priority,oncall: jit,triaged

When using the code snippet bellow, I get this error: `RuntimeError: kind_.is_prim() INTERNAL ASSERT FAILED at /pytorch/torch/csrc/jit/ir.cpp:904, please report a bug to PyTorch. Only prim ops are allowed to not have a registered operator but aten::cat doesn't have one either. We don't know if this op has side effects. (hasSideEffects at /pytorch/torch/csrc/jit/ir.cpp:904)`

```python
import torch
import numpy as np


@torch.jit.script
def get_loss(a, idxs):
    idxs = idxs.split(split_size=1, dim=1)
    b = a.index(idxs)
    return b.sum()


c = torch.zeros(3, 4, 5)
c.requires_grad = True
idxs = torch.tensor(np.array([[0, 1, 2],
                              [0, 0, 4],
                              [0, 2, 4],
                              [2, 3, 0]], dtype=np.long))

loss = get_loss(c, idxs)

```

If `idxs.split(split_size=1, dim=1)` replaced with `list(idxs.split(split_size=1, dim=1))` the error disappears.
PyTorch version is 1.2.0 

cc @ezyang @gchanan @suo
Repository: flutter
Issue: CupertinoTimerPicker minor fidelity issues.
Labels: framework,f: date/time picker,a: fidelity,f: cupertino,has reproducible steps,P2,found in release: 3.3,found in release: 3.7,team-design,triaged-design

When compared with the native count down timer,  `CupertinoTimerPicker` looks and behaves differently in a few places:
- The user should not be allowed to pick 0 hour 0 min. Attempting to do so will cause the min picker to roll up, so it becomes 0 hour 1 min (even when you are changing the hour picker), and the numbers in the min picker becomes gray when the picker is close to 0 hour 0 min. 
- The abbreviations should not end with a ".". i.e. "min." should be "min". The second picker doesn't exist for the native component but in the same vein it should be "sec" instead of "sec.".
- Magnification should be enabled for the selected row of each column.
Repository: TypeScript
Issue: jsdoc object index signature syntax doesn't instantiate type variables
Labels: Bug,Domain: JSDoc,Domain: JavaScript

**Code**

```js
/** @template T */
class C {
  /** @param {T} t */
  constructor(t) {
    /** @type {Object<string, T> } -- does not instantiate T */
    this.ot = { p: t }
    /** @type {{ [s: string]: T }} -- instantiates T */
    this.st = { p: t }
  }
}
var c = new C(1)
c.ot.p // should have type number, has type T
c.st.p // has type number
```

**Expected behavior:**

`c.ot.p : number`

**Actual behavior:**

`c.ot.p : T`

`Object<string, T>` has the syntax of a type alias, but doesn't do any of the instantiation that type aliases do, which is probably the problem.
Repository: rust
Issue: Once `impl_trait_in_bindings` is stable, suggest using it in local bindings
Labels: C-enhancement,A-diagnostics,T-compiler,S-blocked,A-suggestion-diagnostics,F-impl_trait_in_bindings,requires-nightly

https://github.com/rust-lang/rust/pull/63507#discussion_r313274523 introduces a check to _not_ suggest `let foo: impl Trait`. Once this is valid, we should remove that gate.
Repository: pytorch
Issue: Loading custom Torchscript C++ operators in python segfaults due to ABI compatibility issue between pytorch and libtorch
Labels: oncall: jit,triaged

I followed [this](https://pytorch.org/tutorials/advanced/torch_script_custom_ops.html) tutorial and built my custom extension. Everything works with torch 1.1. With torch 1.2 (pytorch and libtorch), building succeeds, the code can be called from C++, but will segfault when I try to load the op in python with `torch.ops.load_library('xx.so')`.

This is what GDB says:

```
Thread 1 "python" received signal SIGSEGV, Segmentation fault.
0x00007ffff2c3119f in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::string const&) ()
   from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
```

After some investigation, it seems as long as the .so file contains a call to `torch::RegisterOperators` (or the deprecated `torch::jit::RegisterOperators`) the loading of the .so file in python will trigger the segfault. The function being exported is irrelevant. Even an identity function passing a tensor unchanged will do.

cc @suo
Repository: TypeScript
Issue: Hovering over JSDoc annotation resolves differently to Intellisense
Labels: Bug,Domain: JSDoc,Domain: Quick Info

Issue Type: <b>Bug</b>

It's possible when hovering over the JSDoc annotation for it to resolve to a different object to what Intellisense will autocomplete to.

To re-create ...

```
// account.js

/**
 * @class
 */
class Account {
  constructor () {
    this.foo = 'foo'
  }
}

module.exports = {
  Account
}
```

```
// index.js

const { account } = require('./account.js')

/**
 * @param {Account} a
 */
const main = (a) => {
  a.foo = ''
}
```

Hovering over the JSDoc will resolve it to the `lib.d.ts` `Account` interface but when typing the `a.foo` in `main` it will autocomplete to the correct Account class.

VS Code version: Code 1.36.1 (2213894ea0415ee8c85c5eea0d0ff81ecc191529, 2019-07-08T22:56:38.504Z)
OS version: Darwin x64 18.6.0

<details>
<summary>System Info</summary>

|Item|Value|
|---|---|
|CPUs|Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz (8 x 2700)|
|GPU Status|2d_canvas: enabled<br>flash_3d: enabled<br>flash_stage3d: enabled<br>flash_stage3d_baseline: enabled<br>gpu_compositing: enabled<br>multiple_raster_threads: enabled_on<br>native_gpu_memory_buffers: enabled<br>oop_rasterization: disabled_off<br>protected_video_decode: unavailable_off<br>rasterization: enabled<br>skia_deferred_display_list: disabled_off<br>skia_renderer: disabled_off<br>surface_synchronization: enabled_on<br>video_decode: enabled<br>viz_display_compositor: disabled_off<br>webgl: enabled<br>webgl2: enabled|
|Load (avg)|2, 2, 2|
|Memory (System)|16.00GB (1.87GB free)|
|Process Argv||
|Screen Reader|no|
|VM|0%|
</details><details><summary>Extensions (10)</summary>

Extension|Author (truncated)|Version
---|---|---
scratchpad|awe|0.1.0
insert-unicode|bru|0.6.0
vscode-standardjs|che|1.2.3
gitlens|eam|9.8.5
nunjucks-template|ese|0.1.2
vscode-docker|ms-|0.7.0
addDocComments|ste|0.0.8
code-spell-checker|str|1.7.17
vscodeintellicode|Vis|1.1.8
vscode-todo-highlight|way|1.0.4


</details>
<!-- generated by issue reporter -->
Repository: pytorch
Issue: "PyTorch core" thread local flag
Labels: module: internals,triaged,enhancement

I propose that we define a thread local flag which is false (default value) in PyTorch user code, and true when we have called into "PyTorch core" code (defined to be the set of code we maintain in this codebase). The most obvious place this flag is flipped is when a user calls an operator we define. The semantics of some operators may behave differently depending on if we are in core or not.

Here are some applications of the flag:

* #7535 is a longstanding, frequently requested feature to have a "global GPU flag" that causes all tensors to be allocated in CUDA by default. We have been wary of implementing this, as such a flag would also affect internal allocations in our library, which probably would not be able to handle this change correctly. With a PyTorch core flag, matters are simple: respect the global GPU flag if !core, and ignore it otherwise. We can similarly make the "default dtype is double" flag more safe this way.

* #23899 wishes to make a major backwards-compatibility breaking change to the stride-handling of some major operations. @VitalyFedyunin proposes that we introduce a flag to let users pick between which behavior they want; @gchanan is concerned it will be too difficult to maintain core code to work in both cases, in this regime. With a PyTorch core flag, respect the memory propagation flag if !core, and ignore it otherwise.
Repository: flutter
Issue: Refactor GPU surface APIs take into account the fact that an external view embedder may want to render to the root surface.
Labels: platform-ios,engine,e: embedder,a: platform-views,P2,team-ios,triaged-ios

Currently, the external view embedder (which was authored later than the GPU surfaces) can only render into overlays. However, this prevents us from presenting a unified view of composition into the root layer as well as overlays without adding hacks to the GPU surfaces to bypass rendering into the root. These hacks come in the form of the `render_to_surface_ ` ivar on the `GPUSurfaceGL`. In the absence of these hacks, extra resources may need to be allocated unnecessarily. Notably, this hack is absent from the software surface.

The GPU surface APIs must be refactored to make the external view embedder a first class citizen of the rasterization subsystem.