Object types automatic conversion [FFI]

Hi DGL team,

I’m working through understanding details of your codebase, and I have to admit I’m not super familiar with some of the C <> Python details so this could be a stupid question.

I’m wondering about the classes defined in /python/dgl/container.py. For example

@register_object
class List(ObjectBase):
    """List container of DGL.

    You do not need to create List explicitly.
    Normally python list and tuple will be converted automatically
    to List during dgl function call.

Do you mind explaining (or pointing me to the documentation I can learn from) on how the automatic conversion is defined. I couldn’t find a clear way in which list types are registered to be converted to List, nor see it being done explicitly in DGL.

Thank you

Hi @Padarn, our FFI system completely inherits from TVM project and maybe you can get some insight there:
https://tvm.apache.org/docs/dev/runtime.html#tvm-runtime-system

1 Like

Hey @zihao thanks a lot for the quick reply. I will check out the TVM docs.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.