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

Method clone

python/dgl/frame.py:881–899  ·  view source on GitHub ↗

Return a clone of this frame. The clone frame does not share the underlying storage with this frame, i.e., adding or removing columns will not be visible to each other. However, they still share the tensor contents so any mutable operation on the column tensor are vi

(self)

Source from the content-addressed store, hash-verified

879 return self._columns.values()
880
881 def clone(self):
882 """Return a clone of this frame.
883
884 The clone frame does not share the underlying storage with this frame,
885 i.e., adding or removing columns will not be visible to each other. However,
886 they still share the tensor contents so any mutable operation on the column
887 tensor are visible to each other. Hence, the function does not allocate extra
888 tensor memory. Use :func:`~dgl.Frame.deepclone` for cloning
889 a frame that does not share any data.
890
891 Returns
892 -------
893 Frame
894 A cloned frame.
895 """
896 newframe = Frame(self._columns, self._num_rows)
897 newframe._initializers = self._initializers
898 newframe._default_initializer = self._default_initializer
899 return newframe
900
901 def deepclone(self):
902 """Return a deep clone of this frame.

Callers 15

toMethod · 0.95
_astype_floatMethod · 0.95
deepcloneMethod · 0.45
createMethod · 0.45
extract_node_subframesFunction · 0.45
extract_edge_subframesFunction · 0.45
__next__Method · 0.45
cloneFunction · 0.45
partition_graphFunction · 0.45
loadMethod · 0.45
processMethod · 0.45
libra_partitionFunction · 0.45

Calls 1

FrameClass · 0.85

Tested by 15

_testFunction · 0.36
_testFunction · 0.36
test_cloneFunction · 0.36
test_edge_softmaxFunction · 0.36
test_spmmFunction · 0.36
test_sddmmFunction · 0.36
test_segment_reduceFunction · 0.36
test_segment_mmFunction · 0.36
test_gather_mm_idx_bFunction · 0.36
_test_gather_mm_idx_aFunction · 0.36
test_module_signFunction · 0.36
test_softmaxFunction · 0.36