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

Method to

python/dgl/frame.py:944–965  ·  view source on GitHub ↗

Return a new frame with columns copy to the targeted device (cpu/gpu). Parameters ---------- device : Framework-specific device context object The context to move data to. kwargs : Key-word arguments. Key-word arguments fed to the framework co

(self, device, **kwargs)

Source from the content-addressed store, hash-verified

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).
946
947 Parameters
948 ----------
949 device : Framework-specific device context object
950 The context to move data to.
951 kwargs : Key-word arguments.
952 Key-word arguments fed to the framework copy function.
953
954 Returns
955 -------
956 Frame
957 A new frame
958 """
959 newframe = self.clone()
960 new_columns = {
961 key: col.to(device, **kwargs)
962 for key, col in newframe._columns.items()
963 }
964 newframe._columns = new_columns
965 return newframe
966
967 def __repr__(self):
968 return repr(dict(self))

Callers 15

__alltoall_cpuFunction · 0.45
linkx_homophilyFunction · 0.45
adjusted_homophilyFunction · 0.45
graphFunction · 0.45
create_blockFunction · 0.45
from_scipyFunction · 0.45
bipartite_from_scipyFunction · 0.45
from_networkxFunction · 0.45
bipartite_from_networkxFunction · 0.45
node_subgraphFunction · 0.45

Calls 2

cloneMethod · 0.95
itemsMethod · 0.45

Tested by 15

test_graph_convFunction · 0.36
test_graph_conv2Function · 0.36
test_graph_conv2_biFunction · 0.36
test_tagconvFunction · 0.36
test_gat_convFunction · 0.36
test_gat_conv_biFunction · 0.36
test_sage_convFunction · 0.36
test_sage_conv_biFunction · 0.36
test_sage_conv_bi2Function · 0.36
test_gg_convFunction · 0.36
test_cheb_convFunction · 0.36
test_agnn_convFunction · 0.36