I got this error when exporting model to ONNX:
/home/dai/py36env/lib/python3.6/site-packages/torch/onnx/utils.py:651: UserWarning: ONNX export failed on primitive operator Uninitialized; please report a bug
  warnings.warn("ONNX export failed on primitive operator {}; please report a bug".format(op_name))
Traceback (most recent call last):
  File "onnx_demo.py", line 280, in <module>
    do_constant_folding=True,input_names=["input"],output_names=["boxes"]
  File "/home/dai/py36env/lib/python3.6/site-packages/torch/onnx/__init__.py", line 143, in export
    strip_doc_string, dynamic_axes, keep_initializers_as_inputs)
  File "/home/dai/py36env/lib/python3.6/site-packages/torch/onnx/utils.py", line 66, in export
    dynamic_axes=dynamic_axes, keep_initializers_as_inputs=keep_initializers_as_inputs)
  File "/home/dai/py36env/lib/python3.6/site-packages/torch/onnx/utils.py", line 382, in _export
    fixed_batch_size=fixed_batch_size)
  File "/home/dai/py36env/lib/python3.6/site-packages/torch/onnx/utils.py", line 262, in _model_to_graph
    fixed_batch_size=fixed_batch_size)
  File "/home/dai/py36env/lib/python3.6/site-packages/torch/onnx/utils.py", line 132, in _optimize_graph
    graph = torch._C._jit_pass_onnx(graph, operator_export_type)
  File "/home/dai/py36env/lib/python3.6/site-packages/torch/onnx/__init__.py", line 174, in _run_symbolic_function
    return utils._run_symbolic_function(*args, **kwargs)
  File "/home/dai/py36env/lib/python3.6/site-packages/torch/onnx/utils.py", line 652, in _run_symbolic_function
    symbolic_fn = sym_registry.get_registered_op(symbolic_name, '', opset_version)
  File "/home/dai/py36env/lib/python3.6/site-packages/torch/onnx/symbolic_registry.py", line 91, in get_registered_op
    return _registry[(domain, version)][opname]
KeyError: 'prim_Uninitialized'

This error could come from these two lines:
if xy_text.size(0) == 0:
        return torch.tensor(0)

What’s the function of prim_Uninitialized? How can I define it? Looking forward to your replay.