MCPcopy Create free account
hub / github.com/alibaba/graph-learn / Layer

Class Layer

graphlearn/python/data/values.py:756–788  ·  view source on GitHub ↗

Layer is 1 hop neighbor nodes and the between edges.

Source from the content-addressed store, hash-verified

754
755
756class Layer(object):
757 """ Layer is 1 hop neighbor nodes and the between edges.
758 """
759
760 def __init__(self, nodes, edges=None, shape=None):
761 """ A `Layer` maintain one hop of `Nodes` and `Edges`."""
762 self._nodes = nodes
763 self._edges = edges
764 self._shape = shape if shape else nodes.shape
765
766 @property
767 def nodes(self):
768 return self._nodes
769
770 @property
771 def edges(self):
772 return self._edges
773
774 @property
775 def shape(self):
776 return self._shape
777
778 @nodes.setter
779 def nodes(self, nodes):
780 self._nodes = nodes
781
782 @edges.setter
783 def edges(self, edges):
784 self._edges = edges
785
786 @shape.setter
787 def shape(self, shape):
788 self._shape = shape
789
790class SubGraph(object):
791 def __init__(self, edge_index, nodes, edges=None, **kwargs):

Callers 2

getMethod · 0.90
getMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected