Skip to content

[JIT] expected ident but found 'where' here #8526

@jamesr66a

Description

@jamesr66a

Operator-level tests fail because we have 'where' as a keyword. Example failure:

======================================================================
ERROR: test_where (__main__.TestAutogradGenerated)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test/test_autograd.py", line 3665, in do_test
    check(name)
  File "test/test_autograd.py", line 3592, in check
    fn, (self_variable,) + args_variable)
  File "test/test_autograd.py", line 3498, in check_against_reference
    outputs_test = func(*nograd_inputs)
  File "test/test_autograd.py", line 3473, in script_fn
    CU = torch.jit.CompilationUnit(script)
  File "/data/users/zdevito/pytorch/torch/jit/__init__.py", line 352, in __init__
    self.define(lang, _frames_up=_frames_up + 1)
  File "/data/users/zdevito/pytorch/torch/jit/__init__.py", line 358, in define
    self.module._define(lang, rcb, False)
RuntimeError: expected ident but found 'where' here:

def the_method(i0, i1, i2):
    return i0.where(i1, i2)
              ~~~~~ <--- HERE

Affected test:

  • test_where
  • test_where_broadcast_all
  • test_where_scalar
  • test_where_scalar_broadcast_mask
  • test_where_scalar_broadcast_non_mask

Metadata

Metadata

Assignees

No one assigned

    Labels

    oncall: jitAdd this issue/PR to JIT oncall triage queue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions