Hi,
I try torch.jit.script as
@torch.jit.script
def add_outlinks(arr, source):
    for dest in arr:
        if _local_dict.get(dest):
            _local_dict[dest].in_links.append(int(source))

On my program, I defined that _loca_dict is a global variable. Therefore, there is no error here. When I add “@torch.jit.script”. The terminal shown the error as
Traceback (most recent call last):
  File "/mnt/c/python_project/Pytorch/test.py", line 222, in <module>
    @torch.jit.script
  File "/home/cnphuong/.local/lib/python3.6/site-packages/torch/jit/__init__.py", line 1290, in script
    fn = torch._C._jit_script_compile(qualified_name, ast, _rcb, get_default_args(obj))
RuntimeError: 
attribute lookup is not defined on python value of type 'dict':
  File "/mnt/c/python_project/Pytorch/test.py", line 225
def add_outlinks(arr, source):
    for dest in arr:
        if _local_dict.get(dest):
           ~~~~~~~~~~~~~~~ <--- HERE
            _local_dict[dest].in_links.append(int(source))

I have to install pytorch from source or not?
My pytorch version is 1.5 and cpu only.
Thanks,