Skip to content

Conversation

@driazati
Copy link
Contributor

@driazati driazati commented Mar 8, 2019

Fixes #17558

The flattened tuple Optional[Tuple[int, int]] could either result in 1 (None) or 2 (int and int) values, so allow this case in ArgumentSpec

@facebook-github-bot facebook-github-bot added the oncall: jit Add this issue/PR to JIT oncall triage queue label Mar 8, 2019
@driazati driazati changed the title [jit] Allow less arguments than the max in ArgumentSpec [jit] Allow fewer arguments than the max in ArgumentSpec Mar 8, 2019
@driazati driazati requested review from eellison and suo March 11, 2019 23:56
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@driazati has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

test/test_jit.py Outdated
if x is None:
new_x = (1, 2)
else:
new_x = torch.jit._unwrap_optional(x)
Copy link
Contributor

Choose a reason for hiding this comment

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

You shouldn't need this

Copy link
Contributor

@eellison eellison left a comment

Choose a reason for hiding this comment

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

LGTM.

Please remove the _unwrap_optional call because it makes it seem like the refinements aren't working & it's not needed.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@driazati has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Optional parameters for Tuple

4 participants