Skip to content

torch.jit.frontend.NotSupportedError: keyword-arg expansion is not supported: for dgl.nn.HeteroGraphConv() #104906

@sabadaftari

Description

@sabadaftari

🚀 The feature, motivation and pitch

Hello,

I get this error once I call the following line after my model is trained.

model_scripted = torch.jit.script(model) # Export to TorchScript
model_scripted.save('model_scripted.pt') # Save

my model has a HeteroGraphConv layer that uses dictionary-based arguments (two node types). However, TorchScript has limitations compared to dynamic Python execution, and keyword argument expansion is one of the features not supported in TorchScript.

Not sure if it's a bug or a feature to be developed, but NotSupportedError made me think it's a feature request.

Thanks!

Alternatives

No response

Additional context

torch.jit.frontend.NotSupportedError: keyword-arg expansion is not supported:
  File "../opt/anaconda3/lib/python3.9/site-packages/dgl/nn/pytorch/hetero.py", line 178
                    (src_inputs[stype], dst_inputs[dtype]),
                    *mod_args.get(etype, ()),
                    **mod_kwargs.get(etype, {}))
                      ~~~~~~~~~~~~~~~~~~~~~~~ <--- HERE
                outputs[dtype].append(dstdata)
        else:

cc @EikanWang @jgong5 @wenzhe-nrv @sanchitintel

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