MCPcopy
hub / github.com/dmlc/dgl / Function

Class Function

python/dgl/_ffi/function.py:42–66  ·  view source on GitHub ↗

The PackedFunc object. Function plays an key role to bridge front and backend in DGL. Function provide a type-erased interface, you can call function with positional arguments. The compiled module returns Function. DGL backend also registers and exposes its API as Functions. Fo

Source from the content-addressed store, hash-verified

40
41
42class Function(_FunctionBase):
43 """The PackedFunc object.
44
45 Function plays an key role to bridge front and backend in DGL.
46 Function provide a type-erased interface, you can call function with positional arguments.
47
48 The compiled module returns Function.
49 DGL backend also registers and exposes its API as Functions.
50 For example, the developer function exposed in dgl.ir_pass are actually
51 C++ functions that are registered as PackedFunc
52
53 The following are list of common usage scenario of dgl.Function.
54
55 - Automatic exposure of C++ API into python
56 - To call PackedFunc from python side
57 - To call python callbacks to inspect results in generated code
58 - Bring python hook into C++ backend
59
60 See Also
61 --------
62 dgl.register_func: How to register global function.
63 dgl.get_global_func: How to get global function.
64 """
65
66 pass # pylint: disable=unnecessary-pass
67
68
69class ModuleBase(object):

Callers 2

get_functionMethod · 0.85
get_global_funcFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected