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

Method subframe

python/dgl/frame.py:922–942  ·  view source on GitHub ↗

Return a new frame whose columns are subcolumns of this frame. The given row IDs should be within range [0, self.num_rows), and allow duplicate IDs. Parameters ---------- rowids : Tensor Row IDs Returns ------- Frame

(self, rowids)

Source from the content-addressed store, hash-verified

920 return newframe
921
922 def subframe(self, rowids):
923 """Return a new frame whose columns are subcolumns of this frame.
924
925 The given row IDs should be within range [0, self.num_rows), and allow
926 duplicate IDs.
927
928 Parameters
929 ----------
930 rowids : Tensor
931 Row IDs
932
933 Returns
934 -------
935 Frame
936 A new subframe.
937 """
938 subcols = {k: col.subcolumn(rowids) for k, col in self._columns.items()}
939 subf = Frame(subcols, len(rowids))
940 subf._initializers = self._initializers
941 subf._default_initializer = self._default_initializer
942 return subf
943
944 def to(self, device, **kwargs): # pylint: disable=invalid-name
945 """Return a new frame with columns copy to the targeted device (cpu/gpu).

Callers 9

invoke_udf_reduceFunction · 0.95
invoke_node_udfFunction · 0.80
invoke_edge_udfFunction · 0.80
_get_n_reprMethod · 0.80
_get_e_reprMethod · 0.80
_create_compute_graphFunction · 0.80
extract_node_subframesFunction · 0.80
extract_edge_subframesFunction · 0.80

Calls 3

FrameClass · 0.85
subcolumnMethod · 0.80
itemsMethod · 0.45

Tested by

no test coverage detected