dmlc--dgl
deb653f8dc
* executor api * draft executor interface * WIP * revert changes to avoid conflict with api change * core scheduling logic * WIP: build graph adj * incidence matrix for in edges * support incidence matrix for partial recv nodes * improve * build adjmat in scheduler * graph store * get degree bucketing schedule * connect to c++ degree bucketing * conceptual executor creation code * executor comments * fix * more executor comments * WIP: full send_and_recv schedule * most schedulers * simplify scheduler * executors * runtime * builtin function base class * adj indices and shape * completely refactor scheduler * rename and move bundled out to function.py * use_edge_feature in msg func * rewrite scheduler * node edge executor * connect with graph api * handle zero degree * misc * fix test cases * fix a good many bugs... * remove old scheduler * push and pull * fix send recv * c++ lint * fix batched send recv * hot fix for mxnet * typo * write back executor * apply node edge * clean up, doc string * fix as requested * refactor * fix * WIP * WIP * ir draft * more on ir * WIP: spmv schedule * WIP * recv schedule * refactor * WIP * snr degree bucketing * snr scheduler * move prog to graph.py; rename * unittest for send/recv * remove some legacy codes * WIP: update_all * pass test_basics * passed all current utests * more utests; fix mx utest * WIP: fixing zero deg initial value * some tests * fix 0deg problem * fix mx * fix mx * some notes * fix as requested
32 行
770 B
Python
32 行
770 B
Python
"""Built-in function base class"""
|
|
from __future__ import absolute_import
|
|
|
|
class BuiltinFunction(object):
|
|
"""Base builtin function class."""
|
|
|
|
def __call__(self):
|
|
"""Regular computation of this builtin function
|
|
|
|
This will be used when optimization is not available.
|
|
"""
|
|
raise NotImplementedError
|
|
|
|
@property
|
|
def name(self):
|
|
"""Return the name of this builtin function."""
|
|
raise NotImplementedError
|
|
|
|
class BundledFunction(object):
|
|
def __init__(self, fn_list):
|
|
self.fn_list = fn_list
|
|
|
|
def __call__(self, *args, **kwargs):
|
|
ret = {}
|
|
for fn in self.fn_list:
|
|
ret.update(fn(*args, **kwargs))
|
|
return ret
|
|
|
|
@property
|
|
def name(self):
|
|
return "bundled"
|