Skip to content

Conversation

@suo
Copy link
Member

@suo suo commented Jun 24, 2020

Stack from ghstack:

Previously, an assignment like self.foo : List[int] = [] would ignore
the type hint.

Differential Revision: D22222927

Previously, an assignment like `self.foo : List[int] = []` would ignore
the type hint.

[ghstack-poisoned]
@suo suo requested a review from apaszke as a code owner June 24, 2020 19:57
@facebook-github-bot facebook-github-bot added the oncall: jit Add this issue/PR to JIT oncall triage queue label Jun 24, 2020
@suo suo requested a review from jamesr66a June 24, 2020 19:57
Previously, an assignment like `self.foo : List[int] = []` would ignore
the type hint.

[ghstack-poisoned]
suo added a commit that referenced this pull request Jun 24, 2020
Previously, an assignment like `self.foo : List[int] = []` would ignore
the type hint.

ghstack-source-id: 3da23ae
Pull Request resolved: #40528
@dr-ci
Copy link

dr-ci bot commented Jun 24, 2020

💊 CI failures summary and remediations

As of commit def2216 (more details on the Dr. CI page):


  • 1/1 failures introduced in this PR

🕵️ 1 new failure recognized by patterns

The following CI failures do not appear to be due to upstream breakages:

See CircleCI build pytorch_windows_vs2019_py36_cuda10.1_test2 (1/1)

Step: "Test" (full log | diagnosis details | 🔁 rerun) <confirmed not flaky by 2 failures>

AssertionError: False is not true
  test_mem_leak (__main__.TestProfiler_cuda) 
Checks that there's no memory leak when using profiler with CUDA ... FAIL (7.401s) 
 
====================================================================== 
FAIL [7.401s]: test_mem_leak (__main__.TestProfiler_cuda) 
Checks that there's no memory leak when using profiler with CUDA 
---------------------------------------------------------------------- 
Traceback (most recent call last): 
  File "test_profiler.py", line 42, in test_mem_leak 
    self.assertTrue(max_diff < 100 * 1024) 
AssertionError: False is not true 
 
---------------------------------------------------------------------- 
Ran 1 test in 7.401s 
 
FAILED (failures=1) 
 
Generating XML reports... 
Generated XML report: test-reports\python-unittest\TEST-TestProfiler_cuda-20200624220527.xml 
Traceback (most recent call last): 
  File "run_test.py", line 727, in <module> 

This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.

Please report bugs/suggestions on the GitHub issue tracker or post in the (internal) Dr. CI Users group.

See how this bot performed.

This comment has been revised 2 times.

@suo suo requested a review from SplitInfinity June 25, 2020 00:06

def test_type_annotation(self):
"""
Test that annotating container attributes with types works correctly

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Test that annotating container attributes with types works correctly
Test that annotating container attributes with types works correctly.


new_list : List[Tuple[float, int, int]] = [(1.0, 1, 1)]
y.my_list = new_list
return y

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need an execution test? I think omitting one is fine because the typechecking for y.my_dict = new_dict and y.my_list = new_list is enough to test that the type annotations for self.my_list and self.my_dict are not ignored, but I just wanted to make sure.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this is a test on the static parts of the type system, so if the thing compiles correctly then we are good from the perspective of this unit test

@facebook-github-bot
Copy link
Contributor

@suo merged this pull request in e231405.

@facebook-github-bot facebook-github-bot deleted the gh/suo/334/head branch June 29, 2020 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Merged oncall: jit Add this issue/PR to JIT oncall triage queue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants