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

Class ExampleLayer

tests/python/mxnet/test_nn.py:734–745  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

732
733 # test single graph
734 class ExampleLayer(gluon.nn.Block):
735 def __init__(self, **kwargs):
736 super().__init__(**kwargs)
737
738 def forward(self, graph, n_feat, e_feat):
739 graph = graph.local_var()
740 graph.ndata["h"] = n_feat
741 graph.update_all(fn.copy_u("h", "m"), fn.sum("m", "h"))
742 n_feat += graph.ndata["h"]
743 graph.apply_edges(fn.u_add_v("h", "h", "e"))
744 e_feat += graph.edata["e"]
745 return n_feat, e_feat
746
747 g = dgl.graph(([], [])).to(F.ctx())
748 g.add_nodes(3)

Callers 1

test_sequentialFunction · 0.70

Calls

no outgoing calls

Tested by 1

test_sequentialFunction · 0.56