Runtime error with JIT compiling a function

Hi, I’m having this error, no python stack, nothing.

pytorch v: 0.4.1

I’ve checked and it related to a function described in this file:

terminate called after throwing an instance of 'std::runtime_error'
  what():  expected ) but found 'ident' here:
aten::_addmv(Tensor self, Tensor mat, Tensor vec, *, Scalar beta=1, Scalar alpha=1) -> Tensor
                                                                    ~~~~~~ <--- HERE

Aborted (core dumped)

Does anyone has an idea of what might be the cause of this error?

The core dump stack:

Program terminated with signal SIGABRT, Aborted.
#0  0x00007f8df1da1428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
54	../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
[Current thread is 1 (Thread 0x7f8df274c700 (LWP 11720))]
(gdb) bt
#0  0x00007f8df1da1428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
#1  0x00007f8df1da302a in __GI_abort () at abort.c:89
#2  0x00007f8deb48db39 in __gnu_cxx::__verbose_terminate_handler () at /opt/conda/conda-bld/compilers_linux-64_1520532893746/work/.build/src/gcc-7.2.0/libstdc++-v3/libsupc++/vterminate.cc:95
#3  0x00007f8deb48c1fb in __cxxabiv1::__terminate (handler=<optimized out>) at /opt/conda/conda-bld/compilers_linux-64_1520532893746/work/.build/src/gcc-7.2.0/libstdc++-v3/libsupc++/eh_terminate.cc:47
#4  0x00007f8deb48c234 in std::terminate () at /opt/conda/conda-bld/compilers_linux-64_1520532893746/work/.build/src/gcc-7.2.0/libstdc++-v3/libsupc++/eh_terminate.cc:57
#5  0x00007f8deb48c416 in __cxxabiv1::__cxa_throw (obj=0x9ffe640, tinfo=0x7f8deb723eb0 <typeinfo for std::runtime_error>, dest=0x7f8deb497c86 <std::runtime_error::~runtime_error()>)
    at /opt/conda/conda-bld/compilers_linux-64_1520532893746/work/.build/src/gcc-7.2.0/libstdc++-v3/libsupc++/eh_throw.cc:93
#6  0x00007f8d6386fde1 in torch::jit::script::Lexer::expected (this=this@entry=0x7ffd5ddafc60, what=..., t=...) at /opt/conda/conda-bld/pytorch_1532579805626/work/torch/csrc/jit/script/lexer.h:447
#7  0x00007f8d63871c21 in torch::jit::script::Lexer::expected (what=..., this=0x7ffd5ddafc60) at /opt/conda/conda-bld/pytorch_1532579805626/work/torch/csrc/jit/script/lexer.h:449
#8  torch::jit::script::Lexer::expect (this=0x7ffd5ddafc60, kind=<optimized out>) at /opt/conda/conda-bld/pytorch_1532579805626/work/torch/csrc/jit/script/lexer.h:455
#9  0x00007f8d638755c2 in torch::jit::script::SchemaParser::parseList<torch::jit::Argument> (begin=40, sep=44, end=41, parse=
    (void (torch::jit::script::SchemaParser::*)(torch::jit::script::SchemaParser * const, std::vector<torch::jit::Argument, std::allocator<torch::jit::Argument> > &)) 0x7f8d63874d70 <torch::jit::script::SchemaParser::parseArgument(std::vector<torch::jit::Argument, std::allocator<torch::jit::Argument> >&)>, result=..., this=0x7ffd5ddafc60) at torch/csrc/jit/operator.cpp:208
#10 torch::jit::script::SchemaParser::parseDeclaration (this=this@entry=0x7ffd5ddafc60) at torch/csrc/jit/operator.cpp:24
#11 0x00007f8d6386ebeb in torch::jit::script::SchemaParser::parseDeclarations (this=0x7ffd5ddafc60) at torch/csrc/jit/operator.cpp:37
#12 torch::jit::parseSchema (schema=...) at torch/csrc/jit/operator.cpp:261
#13 0x00007f8d6386ca8b in torch::jit::Operator::Operator(std::string const&, std::function<std::function<int (std::vector<torch::jit::IValue, std::allocator<torch::jit::IValue> >&)> (torch::jit::Node*)>, std::function<std::function<int (std::vector<torch::jit::IValue, std::allocator<torch::jit::IValue> >&)> (torch::jit::Node*)>) (this=0x7ffd5ddbd2f0, schema=..., op=..., op_const_attributes=...)
    at /opt/conda/conda-bld/pytorch_1532579805626/work/torch/csrc/jit/operator.h:23
#14 0x00007f8d634c49d6 in __static_initialization_and_destruction_0 (__priority=<optimized out>, __initialize_p=<optimized out>) at torch/csrc/jit/generated/register_aten_ops.cpp:15758
#15 0x00007f8df25676ba in call_init (l=<optimized out>, argc=argc@entry=1, argv=argv@entry=0x7ffd5ddde138, env=env@entry=0x264ff40) at dl-init.c:72
#16 0x00007f8df25677cb in call_init (env=0x264ff40, argv=0x7ffd5ddde138, argc=1, l=<optimized out>) at dl-init.c:30
#17 _dl_init (main_map=main_map@entry=0x99758a0, argc=1, argv=0x7ffd5ddde138, env=0x264ff40) at dl-init.c:120
#18 0x00007f8df256c8e2 in dl_open_worker (a=a@entry=0x7ffd5ddd07a0) at dl-open.c:575
#19 0x00007f8df2567564 in _dl_catch_error (objname=objname@entry=0x7ffd5ddd0790, errstring=errstring@entry=0x7ffd5ddd0798, mallocedp=mallocedp@entry=0x7ffd5ddd078f, operate=operate@entry=0x7f8df256c4d0 <dl_open_worker>, 
    args=args@entry=0x7ffd5ddd07a0) at dl-error.c:187
#20 0x00007f8df256bda9 in _dl_open (file=0x7f8d6acea848 "/home/***********/torch/_C.cpython-36m-x86_64-linux-gnu.so", mode=-2147483391, caller_dlopen=0x7f8df19e8191 <_PyImport_FindSharedFuncptr+417>, 
    nsid=-2, argc=<optimized out>, argv=<optimized out>, env=0x264ff40) at dl-open.c:660
#21 0x00007f8df2353f09 in dlopen_doit (a=a@entry=0x7ffd5ddd09d0) at dlopen.c:66
#22 0x00007f8df2567564 in _dl_catch_error (objname=0x7f8df25560d0 <last_result+16>, errstring=0x7f8df25560d8 <last_result+24>, mallocedp=0x7f8df25560c8 <last_result+8>, operate=0x7f8df2353eb0 <dlopen_doit>, args=0x7ffd5ddd09d0)
    at dl-error.c:187
#23 0x00007f8df2354571 in _dlerror_run (operate=operate@entry=0x7f8df2353eb0 <dlopen_doit>, args=args@entry=0x7ffd5ddd09d0) at dlerror.c:163
#24 0x00007f8df2353fa1 in __dlopen (file=file@entry=0x7f8d6acea848 "/home/***********/torch/_C.cpython-36m-x86_64-linux-gnu.so", mode=<optimized out>) at dlopen.c:87
#25 0x00007f8df19e8191 in _PyImport_FindSharedFuncptr (prefix=prefix@entry=0x7f8df1a71746 "PyInit", shortname=shortname@entry=0x7f8d6ad131b8 "_C", 
    pathname=pathname@entry=0x7f8d6acea848 "/home/***********/torch/_C.cpython-36m-x86_64-linux-gnu.so", fp=fp@entry=0x0) at ./Python/dynload_shlib.c:95
#26 0x00007f8df19ba0bf in _PyImport_LoadDynamicModuleWithSpec (spec=spec@entry=0x7f8d6ad0eb00, fp=fp@entry=0x0) at ./Python/importdl.c:129
#27 0x00007f8df19b824b in _imp_create_dynamic_impl (module=<optimized out>, file=<optimized out>, spec=0x7f8d6ad0eb00) at Python/import.c:1994
#28 _imp_create_dynamic (module=<optimized out>, args=<optimized out>) at Python/clinic/import.c.h:289
#29 0x00007f8df18fb1c9 in PyCFunction_Call (func=func@entry=0x7f8df26ffee8, args=args@entry=0x7f8d6ad0e898, kwds=kwds@entry=0x7f8d6ad06fc0) at Objects/methodobject.c:114
#30 0x00007f8df199c8e7 in do_call_core (kwdict=0x7f8d6ad06fc0, callargs=0x7f8d6ad0e898, func=0x7f8df26ffee8) at Python/ceval.c:5095
#31 _PyEval_EvalFrameDefault (f=<optimized out>, throwflag=<optimized out>) at Python/ceval.c:3397
#32 0x00007f8df199409e in _PyEval_EvalCodeWithName (_co=0x7f8df2736db0, globals=globals@entry=0x7f8df26f2cf0, locals=locals@entry=0x0, args=<optimized out>, argcount=2, kwnames=0x0, kwargs=0x99b8100, kwcount=0, 
    kwstep=kwstep@entry=1, defs=0x0, defcount=defcount@entry=0, kwdefs=kwdefs@entry=0x0, closure=0x0, name=name@entry=0x7f8df26e0990, qualname=0x7f8df26e0990) at Python/ceval.c:4159
#33 0x00007f8df19943b2 in fast_function (kwnames=0x0, nargs=<optimized out>, stack=<optimized out>, func=0x7f8df2721ea0) at Python/ceval.c:4971
#34 call_function (pp_stack=pp_stack@entry=0x7ffd5ddd1120, oparg=oparg@entry=2, kwnames=kwnames@entry=0x0) at Python/ceval.c:4851
#35 0x00007f8df199871c in _PyEval_EvalFrameDefault (f=<optimized out>, throwflag=<optimized out>) at Python/ceval.c:3328
#36 0x00007f8df1993730 in _PyFunction_FastCall (co=<optimized out>, args=<optimized out>, nargs=2, globals=<optimized out>) at Python/ceval.c:4912
#37 0x00007f8df1994654 in fast_function (kwnames=0x0, nargs=<optimized out>, stack=<optimized out>, func=0x7f8df26a76a8) at Python/ceval.c:4947
#38 call_function (pp_stack=pp_stack@entry=0x7ffd5ddd1360, oparg=oparg@entry=1, kwnames=kwnames@entry=0x0) at Python/ceval.c:4851
#39 0x00007f8df199871c in _PyEval_EvalFrameDefault (f=<optimized out>, throwflag=<optimized out>) at Python/ceval.c:3328
#40 0x00007f8df1993730 in _PyFunction_FastCall (co=<optimized out>, args=<optimized out>, nargs=1, globals=<optimized out>) at Python/ceval.c:4912
#41 0x00007f8df1994654 in fast_function (kwnames=0x0, nargs=<optimized out>, stack=<optimized out>, func=0x7f8df27019d8) at Python/ceval.c:4947
#42 call_function (pp_stack=pp_stack@entry=0x7ffd5ddd15a0, oparg=oparg@entry=1, kwnames=kwnames@entry=0x0) at Python/ceval.c:4851
#43 0x00007f8df199871c in _PyEval_EvalFrameDefault (f=<optimized out>, throwflag=<optimized out>) at Python/ceval.c:3328
#44 0x00007f8df1993730 in _PyFunction_FastCall (co=<optimized out>, args=<optimized out>, nargs=1, globals=<optimized out>) at Python/ceval.c:4912
#45 0x00007f8df1994654 in fast_function (kwnames=0x0, nargs=<optimized out>, stack=<optimized out>, func=0x7f8df2701bf8) at Python/ceval.c:4947
#46 call_function (pp_stack=pp_stack@entry=0x7ffd5ddd17e0, oparg=oparg@entry=1, kwnames=kwnames@entry=0x0) at Python/ceval.c:4851
#47 0x00007f8df199871c in _PyEval_EvalFrameDefault (f=<optimized out>, throwflag=<optimized out>) at Python/ceval.c:3328
#48 0x00007f8df1993730 in _PyFunction_FastCall (co=<optimized out>, args=<optimized out>, nargs=2, globals=<optimized out>) at Python/ceval.c:4912
#49 0x00007f8df1994654 in fast_function (kwnames=0x0, nargs=<optimized out>, stack=<optimized out>, func=0x7f8df2702d08) at Python/ceval.c:4947
#50 call_function (pp_stack=pp_stack@entry=0x7ffd5ddd1a20, oparg=oparg@entry=2, kwnames=kwnames@entry=0x0) at Python/ceval.c:4851
#51 0x00007f8df199871c in _PyEval_EvalFrameDefault (f=<optimized out>, throwflag=<optimized out>) at Python/ceval.c:3328
#52 0x00007f8df1993730 in _PyFunction_FastCall (co=<optimized out>, args=<optimized out>, nargs=2, globals=<optimized out>) at Python/ceval.c:4912
#53 0x00007f8df199ceb6 in _PyFunction_FastCallDict (func=func@entry=0x7f8df2702d90, args=args@entry=0x7ffd5ddd1c60, nargs=2, kwargs=kwargs@entry=0x0) at Python/ceval.c:5014
#54 0x00007f8df18a1abe in _PyObject_FastCallDict (func=func@entry=0x7f8df2702d90, args=args@entry=0x7ffd5ddd1c60, nargs=<optimized out>, kwargs=kwargs@entry=0x0) at Objects/abstract.c:2310
#55 0x00007f8df18a2cb6 in _PyObject_CallMethodIdObjArgs (callable=0x7f8df2702d90, name=name@entry=0x7f8df1d08740 <PyId__find_and_load.12206>) at Objects/abstract.c:2796
#56 0x00007f8df19b90f4 in PyImport_ImportModuleLevelObject (name=name@entry=0x7f8d6ad0a9f0, globals=<optimized out>, locals=<optimized out>, fromlist=fromlist@entry=0x7f8d6acfe860, level=0) at Python/import.c:1578
#57 0x00007f8df199c60a in import_name (level=0x7f8df1d3bc80 <small_ints+160>, fromlist=0x7f8d6acfe860, name=0x7f8d6ad0a9f0, f=0x9b4f2b8) at Python/ceval.c:5224
---Type <return> to continue, or q <return> to quit---
#58 _PyEval_EvalFrameDefault (f=<optimized out>, throwflag=<optimized out>) at Python/ceval.c:2892
#59 0x00007f8df199409e in _PyEval_EvalCodeWithName (_co=_co@entry=0x7f8d6ad079c0, globals=globals@entry=0x7f8d71a75a20, locals=locals@entry=0x7f8d71a75a20, args=args@entry=0x0, argcount=argcount@entry=0, 
    kwnames=kwnames@entry=0x0, kwargs=kwargs@entry=0x0, kwcount=kwcount@entry=0, kwstep=kwstep@entry=2, defs=defs@entry=0x0, defcount=defcount@entry=0, kwdefs=kwdefs@entry=0x0, closure=closure@entry=0x0, name=name@entry=0x0, 
    qualname=qualname@entry=0x0) at Python/ceval.c:4159
#60 0x00007f8df19946cd in PyEval_EvalCodeEx (_co=_co@entry=0x7f8d6ad079c0, globals=globals@entry=0x7f8d71a75a20, locals=locals@entry=0x7f8d71a75a20, args=args@entry=0x0, argcount=argcount@entry=0, kws=kws@entry=0x0, 
    kwcount=kwcount@entry=0, defs=defs@entry=0x0, defcount=defcount@entry=0, kwdefs=kwdefs@entry=0x0, closure=closure@entry=0x0) at Python/ceval.c:4180
#61 0x00007f8df199471b in PyEval_EvalCode (co=co@entry=0x7f8d6ad079c0, globals=globals@entry=0x7f8d71a75a20, locals=locals@entry=0x7f8d71a75a20) at Python/ceval.c:731
#62 0x00007f8df19918bd in builtin_exec_impl (module=<optimized out>, locals=0x7f8d71a75a20, globals=0x7f8d71a75a20, source=0x7f8d6ad079c0) at Python/bltinmodule.c:983
#63 builtin_exec (module=<optimized out>, args=<optimized out>) at Python/clinic/bltinmodule.c.h:283
#64 0x00007f8df18fafee in _PyCFunction_FastCallDict (func_obj=func_obj@entry=0x7f8df27429d8, args=args@entry=0x7f8d822d5928, nargs=<optimized out>, kwargs=kwargs@entry=0x0) at Objects/methodobject.c:234
#65 0x00007f8df18fb315 in _PyCFunction_FastCallKeywords (func=func@entry=0x7f8df27429d8, stack=stack@entry=0x7f8d822d5928, nargs=<optimized out>, kwnames=kwnames@entry=0x0) at Objects/methodobject.c:294
#66 0x00007f8df199449a in call_function (pp_stack=pp_stack@entry=0x7ffd5ddd22e0, oparg=oparg@entry=2, kwnames=kwnames@entry=0x0) at Python/ceval.c:4830
#67 0x00007f8df199871c in _PyEval_EvalFrameDefault (f=<optimized out>, throwflag=<optimized out>) at Python/ceval.c:3328
#68 0x00007f8df1993730 in _PyFunction_FastCall (co=<optimized out>, args=<optimized out>, nargs=2, globals=<optimized out>) at Python/ceval.c:4912
#69 0x00007f8df1994654 in fast_function (kwnames=0x0, nargs=<optimized out>, stack=<optimized out>, func=0x7f8df262d1e0) at Python/ceval.c:4947
#70 call_function (pp_stack=pp_stack@entry=0x7ffd5ddd2520, oparg=oparg@entry=1, kwnames=kwnames@entry=0x0) at Python/ceval.c:4851
#71 0x00007f8df199871c in _PyEval_EvalFrameDefault (f=<optimized out>, throwflag=<optimized out>) at Python/ceval.c:3328
#72 0x00007f8df1993730 in _PyFunction_FastCall (co=<optimized out>, args=<optimized out>, nargs=1, globals=<optimized out>) at Python/ceval.c:4912
#73 0x00007f8df1994654 in fast_function (kwnames=0x0, nargs=<optimized out>, stack=<optimized out>, func=0x7f8df2701bf8) at Python/ceval.c:4947
#74 call_function (pp_stack=pp_stack@entry=0x7ffd5ddd2760, oparg=oparg@entry=1, kwnames=kwnames@entry=0x0) at Python/ceval.c:4851
#75 0x00007f8df199871c in _PyEval_EvalFrameDefault (f=<optimized out>, throwflag=<optimized out>) at Python/ceval.c:3328
#76 0x00007f8df1993730 in _PyFunction_FastCall (co=<optimized out>, args=<optimized out>, nargs=2, globals=<optimized out>) at Python/ceval.c:4912
#77 0x00007f8df1994654 in fast_function (kwnames=0x0, nargs=<optimized out>, stack=<optimized out>, func=0x7f8df2702d08) at Python/ceval.c:4947
#78 call_function (pp_stack=pp_stack@entry=0x7ffd5ddd29a0, oparg=oparg@entry=2, kwnames=kwnames@entry=0x0) at Python/ceval.c:4851
#79 0x00007f8df199871c in _PyEval_EvalFrameDefault (f=<optimized out>, throwflag=<optimized out>) at Python/ceval.c:3328
#80 0x00007f8df1993730 in _PyFunction_FastCall (co=<optimized out>, args=<optimized out>, nargs=2, globals=<optimized out>) at Python/ceval.c:4912
#81 0x00007f8df199ceb6 in _PyFunction_FastCallDict (func=func@entry=0x7f8df2702d90, args=args@entry=0x7ffd5ddd2be0, nargs=2, kwargs=kwargs@entry=0x0) at Python/ceval.c:5014
#82 0x00007f8df18a1abe in _PyObject_FastCallDict (func=func@entry=0x7f8df2702d90, args=args@entry=0x7ffd5ddd2be0, nargs=<optimized out>, kwargs=kwargs@entry=0x0) at Objects/abstract.c:2310
#83 0x00007f8df18a2cb6 in _PyObject_CallMethodIdObjArgs (callable=0x7f8df2702d90, name=name@entry=0x7f8df1d08740 <PyId__find_and_load.12206>) at Objects/abstract.c:2796
#84 0x00007f8df19b90f4 in PyImport_ImportModuleLevelObject (name=0x7f8df2630ea0, globals=<optimized out>, locals=<optimized out>, fromlist=0x7f8df1cf1910 <_Py_NoneStruct>, level=0) at Python/import.c:1578
#85 0x00007f8df199004f in builtin___import__ (self=<optimized out>, args=<optimized out>, kwds=<optimized out>) at Python/bltinmodule.c:238
#86 0x00007f8d741c0ec2 in ?? ()
#87 0x4fa080c237461c61 in ?? ()
#88 0x00007ffd5ddd2e20 in ?? ()
#89 0x00007ffd5ddd2e80 in ?? ()
#90 0x067bd55ea1f5c000 in ?? ()
#91 0x00007f8d743fd0d0 in ?? ()
#92 0x00007f8d8017cb38 in ?? ()
#93 0x00007f8d80155ca8 in ?? ()
#94 0x00007f8d743fd0d0 in ?? ()
#95 0x00007f8d743fd260 in ?? ()
#96 0x00007f8d743fd228 in ?? ()
#97 0x00007f8d8012a7b8 in ?? ()
#98 0x00007f8d741d9af4 in ?? ()
#99 0x00007f8d80155ca8 in ?? ()
#100 0x00007f8df259a048 in ?? ()
#101 0x00007f8d743fd0d0 in ?? ()
#102 0x00007f8d743fd260 in ?? ()
#103 0x0000

7f8df2630ea0 in ?? ()
#104 0x00007f8d80155ca8 in ?? ()
#105 0x00007f8df1cf1910 in _PyNotImplemented_Type () from /home/***********/libpython3.6m.so.1.0
#106 0x00007f8df1cf1910 in _PyNotImplemented_Type () from /home/***********/libpython3.6m.so.1.0
#107 0x00007f8df1d3bc80 in small_ints () from /home/***********/libpython3.6m.so.1.0
#108 0x067bd55ea1f5c000 in ?? ()
#109 0x00007f8d8017cb38 in ?? ()
#110 0x00007f8d74196607 in ?? ()
#111 0x00007f8d8014f220 in ?? ()
#112 0x00007f8d8017a048 in ?? ()
#113 0x00007ffd5ddd2f28 in ?? ()
#114 0x00007ffd5ddd2f30 in ?? ()
#115 0x00007f8df1d3bc80 in small_ints () from /home/***********/libpython3.6m.so.1.0
#116 0x00007f8df26ed7a0 in ?? ()
#117 0x00007f8df26ed7a0 in ?? ()
#118 0x0000000000000000 in ?? ()
1 Like

Could you post a script that reproduces this crash?

Hi richard, still working on that. Hopped that someone could identify easily the issue, someone with knowledge of the source code.

I’m working with some colleagues to isolate the issue, as we are having different results on different machines and vms also.

Still don’t have a code example, but what I have it the following.

We are packaging an application with pytorch, and somehow there are some scenarios that cause the error in the JIT. One such scenario, though not sure it is reproducible, is running our app trought X11 forwarding inside a vm, though using the vm graphic environment, does not cause the error.

Plus on a host (no vm) we are also getting the error, though, trying to correlate that, seems difficult.

So, my hypothesis is that something on the graphic driver detection layer is causing the JIT to compile some different code, which is leading to the error. Though trying to follow on the code, I could not pinpoint which code is being selected to be compiled by the JIT.

Followed the register_aten_ops, that it seems, it is where the error happens, but I cannot find such file with a line 15758, not even find a file in such location

#14 0x00007f8d634c49d6 in __static_initialization_and_destruction_0 (__priority=<optimized out>, __initialize_p=<optimized out>) at torch/csrc/jit/generated/register_aten_ops.cpp:15758

The collect_env.py returns this:

Collecting environment information...
PyTorch version: 0.4.1
Is debug build: No
CUDA used to build PyTorch: 9.0.176

OS: Ubuntu 16.04.5 LTS
GCC version: (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609
CMake version: version 3.12.1

Python version: 3.6
Is CUDA available: No
CUDA runtime version: No CUDA
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA

Versions of relevant libraries:
[pip] Could not collect
[conda] Could not collect

Not sure if this helps, but importing both urwid, and torch produces this error on my system (pytorch version 0.4.1.post2; urwid version 2.0.1).

import urwid
import torch

crashes with the following message

terminate called after throwing an instance of 'std::runtime_error'
  what():  expected ) but found 'ident' here:
aten::_addmv(Tensor self, Tensor mat, Tensor vec, *, Scalar beta=1, Scalar alpha=1) -> Tensor
                                                                    ~~~~~~ <--- HERE

Aborted (core dumped)